Skip to content

Commit 7ed39fb

Browse files
authored
Use custom Maven version for all our products (#1220)
1 parent 8388ccc commit 7ed39fb

File tree

16 files changed

+43
-70
lines changed

16 files changed

+43
-70
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@ All notable changes to this project will be documented in this file.
1212
### Changed
1313

1414
- all: Use our build-repo to cache NPM dependencies ([#1219])
15+
- java: Use a more recent Maven version for all Java based products ([#1220])
1516

1617
[#1207]: https://github.com/stackabletech/docker-images/pull/1207
1718
[#1215]: https://github.com/stackabletech/docker-images/pull/1215
1819
[#1219]: https://github.com/stackabletech/docker-images/pull/1219
20+
[#1220]: https://github.com/stackabletech/docker-images/pull/1220
1921

2022
## [25.7.0] - 2025-07-23
2123

druid/Dockerfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ cp -r /stackable/patched-libs/maven/* /stackable/.m2/repository
7373
tar -czf /stackable/druid-${NEW_VERSION}-src.tar.gz .
7474

7575
mvn \
76-
--batch-mode \
77-
--no-transfer-progress \
7876
clean install \
7977
-Pdist,stackable-bundle-contrib-exts \
8078
-Dhadoop.compile.version=${HADOOP_VERSION}-stackable${RELEASE} \

hadoop/Dockerfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ cp -r /stackable/patched-libs/maven/* /stackable/.m2/repository
5252
tar -czf /stackable/hdfs-utils-${HDFS_UTILS}-src.tar.gz .
5353

5454
mvn \
55-
--batch-mode \
56-
--no-transfer-progress\
5755
clean package \
5856
-P hadoop-${HADOOP_VERSION} \
5957
-Dhadoop.version=${HADOOP_VERSION}-stackable${RELEASE} \

hadoop/hadoop/Dockerfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,6 @@ tar -czf /stackable/hadoop-${NEW_VERSION}-src.tar.gz .
7676
# Therefore, this build does work but the final image does NOT contain the openssl-devel package which is why it fails there which is why we have to create the symlink over there manually.
7777
# We still leave this flag in to automatically fail should anything with the packages or symlinks ever fail.
7878
mvn \
79-
--batch-mode \
80-
--no-transfer-progress \
8179
clean package install \
8280
-Pdist,native \
8381
-pl '!hadoop-tools/hadoop-pipes' \

hbase/hbase-opa-authorizer/Dockerfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ if [[ -n "$PRODUCT" ]]; then
2020
# Create snapshot of the source code including custom patches
2121
tar -czf /stackable/hbase-opa-authorizer-${PRODUCT}-src.tar.gz .
2222
mvn \
23-
--batch-mode \
24-
--no-transfer-progress \
2523
-DskipTests \
2624
-Dmaven.test.skip=true \
2725
package

hbase/hbase-operator-tools/Dockerfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ mvn versions:set -DnewVersion=$NEW_VERSION
5151
tar -czf /stackable/hbase-operator-tools-${FULL_HBASE_OPERATOR_TOOLS_VERSION}-src.tar.gz .
5252

5353
mvn \
54-
--batch-mode \
55-
--no-transfer-progress \
5654
-Dhbase.version=${PATCHED_HBASE_VERSION} \
5755
-Dhbase-thirdparty.version=${HBASE_THIRDPARTY} \
5856
-DskipTests \

hbase/hbase/Dockerfile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,12 @@ tar -czf /stackable/hbase-${NEW_VERSION}-src.tar.gz .
5454
# I chose to replicate that exact behavior for consistency so please don't merge the two mvn runs into one unless you really know what you're doing!
5555
# Cannot skip building tests here because the assembly plugin needs a shell script from the test directory.
5656
mvn \
57-
--batch-mode \
58-
--no-transfer-progress \
5957
-Dhadoop.profile=3.0 \
6058
-Dhadoop-three.version=${HADOOP_VERSION}-stackable${RELEASE} \
6159
-DskipTests \
6260
clean install
6361

6462
mvn \
65-
--batch-mode \
66-
--no-transfer-progress \
6763
-Dhadoop.profile=3.0 \
6864
-Dhadoop-three.version=${HADOOP_VERSION}-stackable${RELEASE} \
6965
-DskipTests \

hbase/phoenix/Dockerfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ tar -czf /stackable/phoenix-${PRODUCT}-stackable${RELEASE}-src.tar.gz .
4747
# The Maven command can be found inside of the scripts in the create-release folder (release-util.sh as of Phoenix 5.2.0)
4848
# https://github.com/apache/phoenix/tree/5.2.0/dev/create-release
4949
mvn \
50-
--batch-mode \
51-
--no-transfer-progress \
5250
-Dhbase.version=${HBASE_VERSION}-stackable${RELEASE} \
5351
-Dhbase.profile=${HBASE_PROFILE} \
5452
-Dhadoop.version=${HADOOP_VERSION}-stackable${RELEASE} \

hive/Dockerfile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,19 @@ mvn versions:set -DnewVersion=$NEW_VERSION -DartifactId=* -DgroupId=* -Dgenerate
5656
tar -czf /stackable/hive-${NEW_VERSION}-src.tar.gz .
5757

5858
if [[ "${PRODUCT}" == "3.1.3" ]] ; then
59-
mvn --batch-mode --no-transfer-progress clean package -DskipTests --projects standalone-metastore
59+
mvn \
60+
clean package \
61+
-DskipTests \
62+
--projects standalone-metastore
6063
mv standalone-metastore/target/apache-hive-metastore-${NEW_VERSION}-bin/apache-hive-metastore-${NEW_VERSION}-bin /stackable
6164
mv standalone-metastore/target/bom.json /stackable/apache-hive-metastore-${NEW_VERSION}-bin/apache-hive-metastore-${NEW_VERSION}.cdx.json
6265
else
6366
(
6467
# https://issues.apache.org/jira/browse/HIVE-20451 switched the metastore server packaging starting with 4.0.0
65-
mvn --batch-mode --no-transfer-progress clean package -DskipTests -Dhadoop.version=${HADOOP_VERSION}-stackable${RELEASE}
68+
mvn \
69+
clean package \
70+
-DskipTests \
71+
-Dhadoop.version=${HADOOP_VERSION}-stackable${RELEASE}
6672

6773
# We only seem to get a .tar.gz archive, so let's extract that to the correct location
6874
tar --extract --directory=/stackable -f standalone-metastore/metastore-server/target/apache-hive-standalone-metastore-server-${NEW_VERSION}-bin.tar.gz

java-devel/Dockerfile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ FROM stackable/image/stackable-devel
1010
ARG PRODUCT
1111
ARG STACKABLE_USER_UID
1212

13+
# Find the latest version here: https://github.com/apache/maven
14+
# renovate: datasource=github-tags packageName=apache/maven
15+
ARG MAVEN_VERSION="3.9.10"
16+
1317
# See: https://adoptium.net/en-gb/installation/linux/#_centosrhelfedora_instructions
1418
RUN cat <<EOF > /etc/yum.repos.d/adoptium.repo
1519
[Adoptium]
@@ -46,7 +50,6 @@ microdnf install \
4650
krb5-devel \
4751
libcurl-devel \
4852
make \
49-
maven \
5053
openssl-devel \
5154
`# Required to unpack Omid tarball` \
5255
tar \
@@ -56,9 +59,15 @@ microdnf install \
5659
zlib-devel
5760
microdnf clean all
5861
rm -rf /var/cache/yum
62+
63+
curl "https://repo.stackable.tech/repository/packages/maven/apache-maven-${MAVEN_VERSION}-bin.tar.gz" | tar -xzC /tmp
64+
mv /tmp/apache-maven-${MAVEN_VERSION} /opt/maven
65+
ln -s /opt/maven/bin/mvn /usr/bin/mvn
66+
5967
EOF
6068

6169
ENV JAVA_HOME="/usr/lib/jvm/temurin-${PRODUCT}-jdk"
70+
ENV MAVEN_ARGS="--batch-mode --no-transfer-progress"
6271

6372
COPY --chown=${STACKABLE_USER_UID}:0 java-devel/stackable/settings.xml /stackable/.m2/settings.xml
6473
COPY --chown=${STACKABLE_USER_UID}:0 java-devel/stackable/settings.xml /root/.m2/settings.xml

0 commit comments

Comments
 (0)