Skip to content

Commit 5f8a1d4

Browse files
committed
Make the maven build generate the test jar for Python MQTT tests
1 parent 734db99 commit 5f8a1d4

File tree

2 files changed

+66
-0
lines changed

2 files changed

+66
-0
lines changed

external/mqtt/pom.xml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,5 +78,33 @@
7878
<build>
7979
<outputDirectory>target/scala-${scala.binary.version}/classes</outputDirectory>
8080
<testOutputDirectory>target/scala-${scala.binary.version}/test-classes</testOutputDirectory>
81+
82+
<plugins>
83+
<!-- Assemble a jar with test dependencies for Python tests -->
84+
<plugin>
85+
<groupId>org.apache.maven.plugins</groupId>
86+
<artifactId>maven-assembly-plugin</artifactId>
87+
<executions>
88+
<execution>
89+
<id>test-jar-with-dependencies</id>
90+
<phase>package</phase>
91+
<goals>
92+
<goal>single</goal>
93+
</goals>
94+
<configuration>
95+
<!-- Make sure the file path is same as the sbt build -->
96+
<finalName>spark-streaming-mqtt-test-${project.version}</finalName>
97+
<outputDirectory>${project.build.directory}/scala-${scala.binary.version}/</outputDirectory>
98+
<appendAssemblyId>false</appendAssemblyId>
99+
<!-- Don't publish it since it's only for Python tests -->
100+
<attach>false</attach>
101+
<descriptors>
102+
<descriptor>src/main/assembly/assembly.xml</descriptor>
103+
</descriptors>
104+
</configuration>
105+
</execution>
106+
</executions>
107+
</plugin>
108+
</plugins>
81109
</build>
82110
</project>
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<!--
2+
~ Licensed to the Apache Software Foundation (ASF) under one or more
3+
~ contributor license agreements. See the NOTICE file distributed with
4+
~ this work for additional information regarding copyright ownership.
5+
~ The ASF licenses this file to You under the Apache License, Version 2.0
6+
~ (the "License"); you may not use this file except in compliance with
7+
~ the License. You may obtain a copy of the License at
8+
~
9+
~ http://www.apache.org/licenses/LICENSE-2.0
10+
~
11+
~ Unless required by applicable law or agreed to in writing, software
12+
~ distributed under the License is distributed on an "AS IS" BASIS,
13+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
~ See the License for the specific language governing permissions and
15+
~ limitations under the License.
16+
-->
17+
<assembly>
18+
<id>test-jar-with-dependencies</id>
19+
<formats>
20+
<format>jar</format>
21+
</formats>
22+
<includeBaseDirectory>false</includeBaseDirectory>
23+
24+
<dependencySets>
25+
<dependencySet>
26+
<useTransitiveDependencies>true</useTransitiveDependencies>
27+
<scope>test</scope>
28+
<useProjectArtifact>false</useProjectArtifact>
29+
<excludes>
30+
<exclude>org.apache.hadoop:*:jar</exclude>
31+
<exclude>org.apache.spark:*:jar</exclude>
32+
<exclude>org.apache.zookeeper:*:jar</exclude>
33+
<exclude>org.apache.avro:*:jar</exclude>
34+
</excludes>
35+
</dependencySet>
36+
</dependencySets>
37+
38+
</assembly>

0 commit comments

Comments
 (0)