Skip to content

Commit

Permalink
apacheGH-41307: [Java] Use org.apache:apache parent pom version 31 (a…
Browse files Browse the repository at this point in the history
…pache#41772)

Use/update Maven modules to `org.apache:apache:31` and clean up Maven modules to remove unnecessary configuration or outdated workarounds

* Add `org.apache:apache:31` to `org.apache.arrow:arrow-bom` and `org.apache.arrow.maven.plugins:arrow-maven-plugins` to make them conformant with ASF standards
* Update `org.apache.arrow:arrow-java-root` parent to `org.apache:parent:31`
* Use `version.*` and other properties to override plugin versions defined by `org.apache:parent`
* Move standalone plugin versions under pluginManagement at the top level
* Cleanup redundant plugin version or configuration declaration
* Update `maven-dependency-plugin` to 3.6.1 and add the required overrides when necessary
* Update `maven-shade-plugin` to 3.5.1 (via `org.apache:parent`)
  - disable reduced dependency pom creation for non-terminal modules
* Remove enforcer check for java and maven version (handled by `org.apache:parent`)
* Remove unnecessary `mvnrepository` link comments
* Remove `m2e.version` property check in profiles (only needed for errorprone plugin configuration which is incompatible with M2E)
* Cleanup `argLine` overrides for surefire/failsafe plugins
* Remove unnecessary `../pom.xml` `<relativePath>` directives
* Remove source/target/encoding configuration properties for `maven-compiler-plugin`, `maven-javadoc-plugin` and `maven-resources-plugin` as it is handled by `org.apache:parent` and plugin themselves
* Remove unnecessary copy of codegen templates in `arrow-vector` module
* Remove unnecessary junit jupiter engine dependencies for surefire/failsafe plugins.
* GitHub Issue: apache#41307

Lead-authored-by: Laurent Goujon <laurent@apache.org>
Co-authored-by: Laurent Goujon <laurentgo@users.noreply.github.com>
Signed-off-by: David Li <li.davidm96@gmail.com>
  • Loading branch information
laurentgo authored Jun 7, 2024
1 parent 290e606 commit 01d2fa0
Show file tree
Hide file tree
Showing 21 changed files with 226 additions and 466 deletions.
10 changes: 1 addition & 9 deletions ci/scripts/java_full_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,13 @@ fi
# build the entire project
mvn clean \
install \
assembly:single \
source:jar \
javadoc:jar \
-Papache-release \
-Parrow-c-data \
-Parrow-jni \
-Darrow.cpp.build.dir=$dist_dir \
-Darrow.c.jni.dist.dir=$dist_dir \
-DdescriptorId=source-release
-Darrow.c.jni.dist.dir=$dist_dir

# copy all jar, zip and pom files to the distribution folder
find . \
"(" -name "*-javadoc.jar" -o -name "*-sources.jar" ")" \
-exec echo {} ";" \
-exec cp {} $dist_dir ";"
find ~/.m2/repository/org/apache/arrow \
"(" \
-name "*.jar" -o \
Expand Down
2 changes: 0 additions & 2 deletions dev/tasks/tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,6 @@ tasks:
- arrow-jdbc-{no_rc_snapshot_version}.pom
- arrow-maven-plugins-{no_rc_snapshot_version}-cyclonedx.json
- arrow-maven-plugins-{no_rc_snapshot_version}-cyclonedx.xml
- arrow-maven-plugins-{no_rc_snapshot_version}-src.zip
- arrow-maven-plugins-{no_rc_snapshot_version}.pom
- arrow-memory-core-{no_rc_snapshot_version}-cyclonedx.json
- arrow-memory-core-{no_rc_snapshot_version}-cyclonedx.xml
Expand Down Expand Up @@ -851,7 +850,6 @@ tasks:
- module-info-compiler-maven-plugin-{no_rc_snapshot_version}-cyclonedx.xml
- module-info-compiler-maven-plugin-{no_rc_snapshot_version}-javadoc.jar
- module-info-compiler-maven-plugin-{no_rc_snapshot_version}-sources.jar
- module-info-compiler-maven-plugin-{no_rc_snapshot_version}-src.zip
- module-info-compiler-maven-plugin-{no_rc_snapshot_version}.jar
- module-info-compiler-maven-plugin-{no_rc_snapshot_version}.pom

Expand Down
9 changes: 0 additions & 9 deletions java/adapter/avro/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,36 +25,27 @@
<url>http://maven.apache.org</url>

<dependencies>

<!-- https://mvnrepository.com/artifact/org.apache.arrow/arrow-memory-core -->
<dependency>
<groupId>org.apache.arrow</groupId>
<artifactId>arrow-memory-core</artifactId>
</dependency>

<!-- https://mvnrepository.com/artifact/org.apache.arrow/arrow-memory-netty -->
<dependency>
<groupId>org.apache.arrow</groupId>
<artifactId>arrow-memory-netty</artifactId>
<scope>runtime</scope>
</dependency>

<!-- https://mvnrepository.com/artifact/org.apache.arrow/arrow-vector -->
<dependency>
<groupId>org.apache.arrow</groupId>
<artifactId>arrow-vector</artifactId>
</dependency>

<dependency>
<groupId>org.immutables</groupId>
<artifactId>value-annotations</artifactId>
</dependency>

<dependency>
<groupId>org.apache.avro</groupId>
<artifactId>avro</artifactId>
<version>${dep.avro.version}</version>
</dependency>
</dependencies>

</project>
7 changes: 0 additions & 7 deletions java/adapter/jdbc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,17 @@

<dependencies>

<!-- https://mvnrepository.com/artifact/org.apache.arrow/arrow-memory-core -->
<dependency>
<groupId>org.apache.arrow</groupId>
<artifactId>arrow-memory-core</artifactId>
</dependency>

<!-- https://mvnrepository.com/artifact/org.apache.arrow/arrow-memory-netty -->
<dependency>
<groupId>org.apache.arrow</groupId>
<artifactId>arrow-memory-netty</artifactId>
<scope>runtime</scope>
</dependency>

<!-- https://mvnrepository.com/artifact/org.apache.arrow/arrow-vector -->
<dependency>
<groupId>org.apache.arrow</groupId>
<artifactId>arrow-vector</artifactId>
Expand All @@ -51,7 +48,6 @@
<artifactId>value-annotations</artifactId>
</dependency>

<!-- https://mvnrepository.com/artifact/com.h2database/h2 -->
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
Expand Down Expand Up @@ -94,9 +90,6 @@
<id>jdk11+</id>
<activation>
<jdk>[11,]</jdk>
<property>
<name>!m2e.version</name>
</property>
</activation>
<build>
<plugins>
Expand Down
17 changes: 17 additions & 0 deletions java/adapter/orc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -134,5 +134,22 @@
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>analyze</id>
<configuration>
<ignoredDependencies combine.children="append">
<!-- indirect use of org.apache.arrow.flatbuf.Message in OrcStripeReader -->
<ignoredDependency>org.apache.arrow:arrow-format</ignoredDependency>
</ignoredDependencies>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
44 changes: 37 additions & 7 deletions java/bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<parent>
<groupId>org.apache</groupId>
<artifactId>apache</artifactId>
<version>18</version>
<version>31</version>
</parent>

<groupId>org.apache.arrow</groupId>
Expand All @@ -27,6 +27,19 @@

<properties>
<arrow.vector.classifier></arrow.vector.classifier>
<!-- org.apache:apache overrides -->
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.plugin.tools.version>3.12.0</maven.plugin.tools.version>
<surefire.version>3.2.5</surefire.version>
<version.apache-rat-plugin>0.16.1</version.apache-rat-plugin>
<version.maven-assembly-plugin>3.7.1</version.maven-assembly-plugin>
<version.maven-compiler-plugin>3.12.1</version.maven-compiler-plugin>
<version.maven-dependency-plugin>3.6.1</version.maven-dependency-plugin>
<version.maven-gpg-plugin>3.2.4</version.maven-gpg-plugin>
<version.maven-jar-plugin>3.2.2</version.maven-jar-plugin>
<version.maven-javadoc-plugin>3.6.3</version.maven-javadoc-plugin>
<version.maven-project-info-reports-plugin>3.5.0</version.maven-project-info-reports-plugin>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -138,11 +151,9 @@
<version>${project.version}</version>
</dependency>
</dependencies>

</dependencyManagement>

<build>

<pluginManagement>
<plugins>
<plugin>
Expand All @@ -156,12 +167,10 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.5.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.12.1</version>
</plugin>
<plugin>
<groupId>com.diffplug.spotless</groupId>
Expand All @@ -188,13 +197,34 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.5.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.12.1</version>
</plugin>
</plugins>
</reporting>

<profiles>
<profile>
<id>apache-release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>source-release-assembly</id>
<configuration>
<!-- source release assembly is managed at the root of the project. -->
<skipAssembly>true</skipAssembly>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
1 change: 0 additions & 1 deletion java/c/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,4 @@
</resource>
</resources>
</build>

</project>
29 changes: 4 additions & 25 deletions java/flight/flight-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
<groupId>org.apache.arrow</groupId>
<artifactId>arrow-flight</artifactId>
<version>17.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>flight-core</artifactId>
Expand Down Expand Up @@ -151,13 +150,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<!--
Downgrade maven-shade-plugin specifically for this module.
Using a newer version up to at least 3.5.1 will cause
issues in the arrow-tools tests looking up FlatBuffer
dependencies.
-->
<version>3.2.4</version>
<executions>
<execution>
<id>shade-main</id>
Expand All @@ -166,6 +158,7 @@
</goals>
<phase>package</phase>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<shadedArtifactAttached>true</shadedArtifactAttached>
<shadedClassifierName>shaded</shadedClassifierName>
<artifactSet>
Expand All @@ -192,6 +185,7 @@
</goals>
<phase>package</phase>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<shadedArtifactAttached>true</shadedArtifactAttached>
<shadedClassifierName>shaded-ext</shadedClassifierName>
<artifactSet>
Expand Down Expand Up @@ -244,7 +238,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<id>analyze</id>
Expand All @@ -264,7 +257,6 @@
<!-- add generated sources to classpath -->
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.9.1</version>
<executions>
<execution>
<id>add-generated-sources-to-classpath</id>
Expand All @@ -282,7 +274,6 @@
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.7.1</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
Expand All @@ -299,32 +290,21 @@
</executions>
</plugin>
</plugins>
<extensions>
<extension>
<groupId>kr.motd.maven</groupId>
<artifactId>os-maven-plugin</artifactId>
<version>1.7.1</version>
</extension>
</extensions>
</build>

<profiles>
<profile>
<id>jdk11+</id>
<activation>
<jdk>[11,]</jdk>
<property>
<name>!m2e.version</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration combine.self="override">
<argLine>--add-opens=org.apache.arrow.flight.core/org.apache.arrow.flight.perf.impl=protobuf.java --add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED</argLine>
<enableAssertions>false</enableAssertions>
<configuration>
<argLine combine.self="override">--add-opens=org.apache.arrow.flight.core/org.apache.arrow.flight.perf.impl=protobuf.java --add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED</argLine>
<systemPropertyVariables>
<arrow.test.dataRoot>${project.basedir}/../../../testing/data</arrow.test.dataRoot>
</systemPropertyVariables>
Expand All @@ -334,5 +314,4 @@
</build>
</profile>
</profiles>

</project>
2 changes: 0 additions & 2 deletions java/flight/flight-integration-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
<groupId>org.apache.arrow</groupId>
<artifactId>arrow-flight</artifactId>
<version>17.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>flight-integration-tests</artifactId>
Expand Down Expand Up @@ -63,7 +62,6 @@
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.7.1</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
Expand Down
Loading

0 comments on commit 01d2fa0

Please sign in to comment.