Skip to content

Commit

Permalink
apacheGH-38832: [Java] Avoid building twice in `ci/scripts/java_build…
Browse files Browse the repository at this point in the history
….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 <pitrou@free.fr>
Co-authored-by: Antoine Pitrou <antoine@python.org>
Co-authored-by: david dali susanibar arce <davi.sarces@gmail.com>
Signed-off-by: Antoine Pitrou <antoine@python.org>
  • Loading branch information
3 people authored Nov 21, 2023
1 parent c5a1eb0 commit 3af33bc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ci/scripts/java_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,20 +77,20 @@ mvn="${mvn} -T 2C"

pushd ${source_dir}

${mvn} install

if [ "${ARROW_JAVA_SHADE_FLATBUFFERS}" == "ON" ]; then
${mvn} -Pshade-flatbuffers install
mvn="${mvn} -Pshade-flatbuffers"
fi

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

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

${mvn} install

if [ "${BUILD_DOCS_JAVA}" == "ON" ]; then
# HTTP pooling is turned of to avoid download issues https://issues.apache.org/jira/browse/ARROW-11633
mkdir -p ${build_dir}/docs/java/reference
Expand Down

0 comments on commit 3af33bc

Please sign in to comment.