This is an automated email from the ASF dual-hosted git repository.
apitrou pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/main by this push:
new 3af33bc019 GH-38832: [Java] Avoid building twice in
`ci/scripts/java_build.sh` (#38829)
3af33bc019 is described below
commit 3af33bc01959db1ae86f4f31e60ee7e968ffdba3
Author: Antoine Pitrou <[email protected]>
AuthorDate: Tue Nov 21 18:53:46 2023 +0100
GH-38832: [Java] Avoid building twice in `ci/scripts/java_build.sh` (#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: #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]>
---
ci/scripts/java_build.sh | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/ci/scripts/java_build.sh b/ci/scripts/java_build.sh
index 66ea8d677d..77dd1ccdaf 100755
--- a/ci/scripts/java_build.sh
+++ b/ci/scripts/java_build.sh
@@ -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