Skip to content

Commit 3af33bc

Browse files
apacheGH-38832: [Java] Avoid building twice in ci/scripts/java_build.sh (apache#38829)
### Rationale for this change `ci/scripts/java_build.sh` can invoke `mvn install` several times on the Arrow Java codebase. This happens especially in JNI and Integration builds, which have some optional components enabled. ### What changes are included in this PR? Only invoke `mvn install` once. This change seems to save around 5 minutes on the JNI and Integration builds. ### Are these changes tested? Yes. ### Are there any user-facing changes? No. * Closes: apache#38832 Lead-authored-by: Antoine Pitrou <[email protected]> Co-authored-by: Antoine Pitrou <[email protected]> Co-authored-by: david dali susanibar arce <[email protected]> Signed-off-by: Antoine Pitrou <[email protected]>
1 parent c5a1eb0 commit 3af33bc

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Diff for: ci/scripts/java_build.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -77,20 +77,20 @@ mvn="${mvn} -T 2C"
7777

7878
pushd ${source_dir}
7979

80-
${mvn} install
81-
8280
if [ "${ARROW_JAVA_SHADE_FLATBUFFERS}" == "ON" ]; then
83-
${mvn} -Pshade-flatbuffers install
81+
mvn="${mvn} -Pshade-flatbuffers"
8482
fi
8583

8684
if [ "${ARROW_JAVA_CDATA}" = "ON" ]; then
87-
${mvn} -Darrow.c.jni.dist.dir=${java_jni_dist_dir} -Parrow-c-data install
85+
mvn="${mvn} -Darrow.c.jni.dist.dir=${java_jni_dist_dir} -Parrow-c-data"
8886
fi
8987

9088
if [ "${ARROW_JAVA_JNI}" = "ON" ]; then
91-
${mvn} -Darrow.cpp.build.dir=${java_jni_dist_dir} -Parrow-jni install
89+
mvn="${mvn} -Darrow.cpp.build.dir=${java_jni_dist_dir} -Parrow-jni"
9290
fi
9391

92+
${mvn} install
93+
9494
if [ "${BUILD_DOCS_JAVA}" == "ON" ]; then
9595
# HTTP pooling is turned of to avoid download issues https://issues.apache.org/jira/browse/ARROW-11633
9696
mkdir -p ${build_dir}/docs/java/reference

0 commit comments

Comments
 (0)