Skip to content

Commit 92f23ec

Browse files
ctubbsiieolivelli
authored andcommitted
ZOOKEEPER-3791: Miscellaneous Maven fixes
* Fix fatjar and full-build profile problems with redundant module activation * Remove "activeByDefault" profiles that don't do anything useful * Make javadoc a bit quieter * Fix assembly plugin warning about `/` * Fix antrun warnings about tasks config renamed to target * Fix docs module packaging (doesn't need to be jar) * Fix zookeeper-it module by moving classes into standarad Maven directory layout and configuring surefire plugin to find the tests Author: Christopher Tubbs <ctubbsii@apache.org> Reviewers: Enrico Olivelli <eolivelli@apache.org>, Norbert Kalmar <nkalmar@apache.org> Closes #1314 from ctubbsii/misc-maven-fixes
1 parent bbe3029 commit 92f23ec

26 files changed

Lines changed: 76 additions & 84 deletions

File tree

‎.travis.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ addons:
2626
packages:
2727
- libcppunit-dev
2828

29-
script: mvn clean apache-rat:check install -DskipTests spotbugs:check checkstyle:check -Pfull-build
29+
script: mvn clean apache-rat:check verify -DskipTests spotbugs:check checkstyle:check -Pfull-build
3030

3131
branches:
3232
only:

‎pom.xml‎

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -259,21 +259,19 @@
259259
<id>full-build</id>
260260
<modules>
261261
<module>zookeeper-contrib</module>
262+
<!-- zookeeper-it needed by fatjar contrib -->
263+
<module>zookeeper-it</module>
262264
</modules>
263265
</profile>
264266
<profile>
267+
<!-- fatjar only profile; zookeeper-contrib will activate the fatjar in its pom -->
265268
<id>fatjar</id>
266269
<modules>
270+
<module>zookeeper-contrib</module>
271+
<!-- zookeeper-it needed by fatjar contrib -->
267272
<module>zookeeper-it</module>
268-
<module>zookeeper-contrib/zookeeper-contrib-fatjar</module>
269273
</modules>
270274
</profile>
271-
<profile>
272-
<id>java-build</id>
273-
<activation>
274-
<activeByDefault>true</activeByDefault>
275-
</activation>
276-
</profile>
277275
<profile>
278276
<id>apache-release</id>
279277
<build>
@@ -446,7 +444,7 @@
446444
<commons-collections.version>3.2.2</commons-collections.version>
447445
<commons-lang.version>2.6</commons-lang.version>
448446
<dropwizard.version>3.2.5</dropwizard.version>
449-
<spotbugsannotations.version>3.1.9</spotbugsannotations.version>
447+
<spotbugsannotations.version>4.0.2</spotbugsannotations.version>
450448
<checkstyle.version>8.17</checkstyle.version>
451449

452450
<!-- parameters to pass to C client build -->
@@ -672,8 +670,9 @@
672670
<plugin>
673671
<groupId>org.apache.maven.plugins</groupId>
674672
<artifactId>maven-javadoc-plugin</artifactId>
675-
<version>3.0.1</version>
673+
<version>3.1.1</version>
676674
<configuration>
675+
<quiet>true</quiet>
677676
<doclint>none</doclint>
678677
</configuration>
679678
</plugin>
@@ -685,7 +684,7 @@
685684
<plugin>
686685
<groupId>org.apache.maven.plugins</groupId>
687686
<artifactId>maven-release-plugin</artifactId>
688-
<version>2.5.3</version>
687+
<version>3.0.0-M1</version>
689688
</plugin>
690689
<plugin>
691690
<groupId>org.apache.maven.plugins</groupId>
@@ -738,7 +737,7 @@
738737
<plugin>
739738
<groupId>com.github.spotbugs</groupId>
740739
<artifactId>spotbugs-maven-plugin</artifactId>
741-
<version>3.1.9</version>
740+
<version>4.0.0</version>
742741
<configuration>
743742
<excludeFilterFile>excludeFindBugsFilter.xml</excludeFilterFile>
744743
</configuration>
@@ -958,23 +957,22 @@
958957
<exclude>src/main/resources/markdown/html/*</exclude>
959958
<exclude>src/main/resources/markdown/images/*</exclude>
960959
<!-- contrib -->
961-
<exclude>zookeeper-contrib-monitoring/JMX-RESOURCES</exclude>
962-
<exclude>zookeeper-contrib-fatjar/src/main/resources/mainClasses</exclude>
963-
<exclude>zookeeper-contrib-zkperl/Changes</exclude>
964-
<exclude>zookeeper-contrib-zkperl/MANIFEST</exclude>
965-
<exclude>zookeeper-contrib-zkpython/src/test/zoo.cfg</exclude>
966-
<exclude>zookeeper-contrib-loggraph/src/main/resources/webapp/org/apache/zookeeper/graph/resources/*</exclude>
967-
<exclude>src/main/resources/webapp/org/apache/zookeeper/graph/resources/*</exclude>
968-
<exclude>src/main/java/com/nitido/utils/toaster/Toaster.java</exclude>
969-
<exclude>TODO</exclude>
960+
<exclude>**/JMX-RESOURCES</exclude>
961+
<exclude>**/src/main/resources/mainClasses</exclude>
962+
<exclude>**/Changes</exclude>
963+
<exclude>**/MANIFEST</exclude>
964+
<exclude>**/src/test/zoo.cfg</exclude>
965+
<exclude>**/src/main/resources/webapp/org/apache/zookeeper/graph/resources/*</exclude>
966+
<exclude>**/src/main/java/com/nitido/utils/toaster/Toaster.java</exclude>
967+
<exclude>**/TODO</exclude>
970968
<!-- c client -->
971969
<exclude>**/acinclude.m4</exclude>
972970
<exclude>**/aminclude.am</exclude>
973-
<exclude>src/hashtable/*</exclude>
974-
<exclude>include/winconfig.h</exclude>
975-
<exclude>tests/wrappers.opt</exclude>
976-
<exclude>tests/zoo.cfg</exclude>
977-
<exclude>tests/wrappers-mt.opt</exclude>
971+
<exclude>**/src/hashtable/*</exclude>
972+
<exclude>**/include/winconfig.h</exclude>
973+
<exclude>**/tests/wrappers.opt</exclude>
974+
<exclude>**/tests/zoo.cfg</exclude>
975+
<exclude>**/tests/wrappers-mt.opt</exclude>
978976
<exclude>**/c-doc.Doxyfile</exclude>
979977
</excludes>
980978
<consoleOutput>true</consoleOutput>
@@ -986,8 +984,12 @@
986984
<inherited>false</inherited>
987985
<configuration>
988986
<!-- update the version inside the C sources -->
989-
<preparationGoals>clean install -DskipTests antrun:run@replace-cclient-files-during-release scm:add@add-cclient-files-during-release scm:checkin@commit-cclient-files-during-release</preparationGoals>
990-
<completionGoals>clean install -DskipTests antrun:run@replace-cclient-files-during-release scm:add@add-cclient-files-during-release scm:checkin@commit-cclient-files-during-release</completionGoals>
987+
<preparationGoals>clean verify -DskipTests antrun:run@replace-cclient-files-during-release scm:add@add-cclient-files-during-release scm:checkin@commit-cclient-files-during-release</preparationGoals>
988+
<completionGoals>clean verify -DskipTests antrun:run@replace-cclient-files-during-release scm:add@add-cclient-files-during-release scm:checkin@commit-cclient-files-during-release</completionGoals>
989+
<pushChanges>false</pushChanges>
990+
<localCheckout>true</localCheckout>
991+
<autoVersionSubmodules>true</autoVersionSubmodules>
992+
<tagNameFormat>release-@{project.version}</tagNameFormat>
991993
</configuration>
992994
</plugin>
993995
<plugin>

‎zookeeper-assembly/pom.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
<groupId>org.apache.zookeeper</groupId>
2525
<artifactId>parent</artifactId>
2626
<version>3.7.0-SNAPSHOT</version>
27-
<relativePath>..</relativePath>
2827
</parent>
2928

3029
<artifactId>zookeeper-assembly</artifactId>
@@ -53,6 +52,7 @@
5352
<groupId>org.apache.zookeeper</groupId>
5453
<artifactId>zookeeper-docs</artifactId>
5554
<version>${project.version}</version>
55+
<type>pom</type>
5656
</dependency>
5757
<dependency>
5858
<groupId>org.apache.zookeeper</groupId>

‎zookeeper-assembly/src/main/assembly/lib-package.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
<includes>
5555
<include>LICENSE</include>
5656
</includes>
57-
<outputDirectory>/</outputDirectory>
57+
<outputDirectory>.</outputDirectory>
5858
<fileMode>${rw.file.permission}</fileMode>
5959
<directoryMode>${rwx.file.permission}</directoryMode>
6060
</fileSet>

‎zookeeper-client/pom.xml‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
<groupId>org.apache.zookeeper</groupId>
2525
<artifactId>parent</artifactId>
2626
<version>3.7.0-SNAPSHOT</version>
27-
<relativePath>..</relativePath>
2827
</parent>
2928

3029
<artifactId>zookeeper-client</artifactId>
@@ -39,10 +38,6 @@
3938
<module>zookeeper-client-c</module>
4039
</modules>
4140
</profile>
42-
<profile>
43-
<id>java-build</id>
44-
<modules />
45-
</profile>
4641
</profiles>
4742
<build>
4843
<plugins>
@@ -55,4 +50,4 @@
5550
</plugin>
5651
</plugins>
5752
</build>
58-
</project>
53+
</project>

‎zookeeper-client/zookeeper-client-c/pom.xml‎

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,30 +24,24 @@
2424
<groupId>org.apache.zookeeper</groupId>
2525
<artifactId>zookeeper-client</artifactId>
2626
<version>3.7.0-SNAPSHOT</version>
27-
<relativePath>..</relativePath>
2827
</parent>
2928

3029
<artifactId>zookeeper-client-c</artifactId>
31-
<packaging>jar</packaging>
30+
<packaging>pom</packaging>
3231
<name>Apache ZooKeeper - Client - C</name>
3332
<description>ZooKeeper c client</description>
3433

34+
<properties>
35+
<c-test-coverage-arg> </c-test-coverage-arg>
36+
</properties>
37+
3538
<profiles>
3639
<profile>
3740
<id>c-test-coverage</id>
3841
<properties>
3942
<c-test-coverage-arg>--enable-gcov</c-test-coverage-arg>
4043
</properties>
4144
</profile>
42-
<profile>
43-
<id>no-c-test-coverage</id>
44-
<activation>
45-
<activeByDefault>true</activeByDefault>
46-
</activation>
47-
<properties>
48-
<c-test-coverage-arg> </c-test-coverage-arg>
49-
</properties>
50-
</profile>
5145
</profiles>
5246

5347
<build>
@@ -104,9 +98,9 @@
10498
<id>generate-sources</id>
10599
<phase>generate-sources</phase>
106100
<configuration>
107-
<tasks>
101+
<target>
108102
<mkdir dir="target/c" />
109-
</tasks>
103+
</target>
110104
</configuration>
111105
<goals>
112106
<goal>run</goal>
@@ -116,7 +110,7 @@
116110
<id>build-c-client</id>
117111
<phase>compile</phase>
118112
<configuration>
119-
<tasks>
113+
<target>
120114
<exec dir="${basedir}/target/c" executable="make" failonerror="true">
121115
<env key="LD_LIBRARY_PATH" value="${env.LD_LIBRARY_PATH};/usr/lib" />
122116
<env key="PATH" path="${env.PATH};${basedir};" />
@@ -125,7 +119,7 @@
125119
<env key="base_dir" value="${basedir}/../.." />
126120
<arg line="clean install" />
127121
</exec>
128-
</tasks>
122+
</target>
129123
</configuration>
130124
<goals>
131125
<goal>run</goal>
@@ -137,7 +131,7 @@
137131
<configuration>
138132
<!-- do not run cpp tests if tests are globally skipped -->
139133
<skip>${skipTests}</skip>
140-
<tasks>
134+
<target>
141135
<exec dir="${basedir}/target/c" executable="make" failonerror="true">
142136
<env key="LD_LIBRARY_PATH" value="${env.LD_LIBRARY_PATH};/usr/lib" />
143137
<env key="PATH" path="${env.PATH};${basedir};" />
@@ -146,7 +140,7 @@
146140
<env key="base_dir" value="${basedir}/../.." />
147141
<arg line="check" />
148142
</exec>
149-
</tasks>
143+
</target>
150144
</configuration>
151145
<goals>
152146
<goal>run</goal>

‎zookeeper-contrib/pom.xml‎

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,20 @@
3434
Contrib projects to Apache ZooKeeper
3535
</description>
3636

37-
<modules>
38-
<module>zookeeper-contrib-loggraph</module>
39-
<module>zookeeper-contrib-rest</module>
40-
<module>zookeeper-contrib-zooinspector</module>
41-
</modules>
37+
<properties>
38+
<spotbugs.skip>true</spotbugs.skip>
39+
</properties>
4240

4341
<profiles>
42+
<profile>
43+
<id>full-build</id>
44+
<modules>
45+
<module>zookeeper-contrib-fatjar</module>
46+
<module>zookeeper-contrib-loggraph</module>
47+
<module>zookeeper-contrib-rest</module>
48+
<module>zookeeper-contrib-zooinspector</module>
49+
</modules>
50+
</profile>
4451
<profile>
4552
<id>fatjar</id>
4653
<modules>
@@ -49,10 +56,6 @@
4956
</profile>
5057
</profiles>
5158

52-
<properties>
53-
<spotbugs.skip>true</spotbugs.skip>
54-
</properties>
55-
5659
<build>
5760
<pluginManagement>
5861
<plugins>

‎zookeeper-docs/pom.xml‎

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@
2424
<groupId>org.apache.zookeeper</groupId>
2525
<artifactId>parent</artifactId>
2626
<version>3.7.0-SNAPSHOT</version>
27-
<relativePath>..</relativePath>
2827
</parent>
2928

3029
<artifactId>zookeeper-docs</artifactId>
3130
<name>Apache ZooKeeper - Documentation</name>
3231
<description>Documentation</description>
32+
<packaging>pom</packaging>
3333

3434
<build>
3535
<plugins>
@@ -58,13 +58,6 @@
5858
<skip>true</skip>
5959
</configuration>
6060
</plugin>
61-
<plugin>
62-
<groupId>org.apache.maven.plugins</groupId>
63-
<artifactId>maven-javadoc-plugin</artifactId>
64-
<configuration>
65-
<skip>true</skip>
66-
</configuration>
67-
</plugin>
6861
</plugins>
6962
</build>
7063
</project>

‎zookeeper-it/pom.xml‎

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,13 @@
3333
ZooKeeper system tests
3434
</description>
3535

36+
<!-- (temporarily) disable quality checks in this module for known failures to be fixed later -->
37+
<properties>
38+
<skipTests>true</skipTests>
39+
<spotbugs.skip>true</spotbugs.skip>
40+
<checkstyle.skip>true</checkstyle.skip>
41+
</properties>
42+
3643
<dependencies>
3744
<dependency>
3845
<groupId>org.apache.zookeeper</groupId>
@@ -63,15 +70,17 @@
6370
</dependencies>
6471

6572
<build>
66-
<sourceDirectory>src</sourceDirectory>
67-
<plugins>
68-
<plugin>
69-
<groupId>org.apache.maven.plugins</groupId>
70-
<artifactId>maven-javadoc-plugin</artifactId>
71-
<configuration>
72-
<sourcepath>src</sourcepath>
73-
</configuration>
74-
</plugin>
75-
</plugins>
73+
<pluginManagement>
74+
<plugins>
75+
<plugin>
76+
<groupId>org.apache.maven.plugins</groupId>
77+
<artifactId>maven-surefire-plugin</artifactId>
78+
<configuration>
79+
<testSourceDirectory>${project.basedir}/src/main/java/</testSourceDirectory>
80+
<testClassesDirectory>${project.build.directory}/classes/</testClassesDirectory>
81+
</configuration>
82+
</plugin>
83+
</plugins>
84+
</pluginManagement>
7685
</build>
7786
</project>

zookeeper-it/src/test/bench/org/apache/zookeeper/BenchMain.java renamed to zookeeper-it/src/main/java/org/apache/zookeeper/BenchMain.java

File renamed without changes.

0 commit comments

Comments
 (0)