I created a image with jdk1.8-maven3.9.6 as my application needs jdk1.8
FROM amazoncorretto:8-al2023-jdk
ARG MAVEN_VERSION=3.9.6
ARG USER_HOME_DIR="/app"
ENV MAVEN_CONFIG "$USER_HOME_DIR/.m2"
ARG SHA=706f01b20dec0305a822ab614d51f32b07ee11d0218175e55450242e49d2156386483b506b3a4e8a03ac8611bae96395fd5eec15f50d3013d5deed6d1ee18224
ARG BASE_URL="https://downloads.apache.org/maven/maven-3/${MAVEN_VERSION}/binaries"
#using dnf instead of apt-get
RUN dnf update -y \
&& dnf install -y --allowerasing \
ca-certificates curl git gnupg dirmngr tar \
&& dnf clean all
RUN mkdir -p /usr/share/maven && mkdir -p /app
RUN set -eux; curl -fsSLO --compressed ${BASE_URL}/apache-maven-${MAVEN_VERSION}-bin.tar.gz \
&& echo "${SHA} *apache-maven-${MAVEN_VERSION}-bin.tar.gz" | sha512sum -c - \
&& curl -fsSLO --compressed ${BASE_URL}/apache-maven-${MAVEN_VERSION}-bin.tar.gz.asc \
&& export GNUPGHOME="$(mktemp -d)"; \
for key in \
6A814B1F869C2BBEAB7CB7271A2A1C94BDE89688 \
29BEA2A645F2D6CED7FB12E02B172E3E156466E8 \
; do \
gpg --batch --keyserver hkps://keyserver.ubuntu.com --recv-keys "$key" ; \
done; \
gpg --batch --verify apache-maven-${MAVEN_VERSION}-bin.tar.gz.asc apache-maven-${MAVEN_VERSION}-bin.tar.gz
COPY settings.xml /app/.m2/settings.xml
ENV MAVEN_HOME /usr/share/maven
RUN mkdir -p ${MAVEN_HOME} ${MAVEN_HOME}/ref \
&& tar -xzf apache-maven-${MAVEN_VERSION}-bin.tar.gz -C ${MAVEN_HOME} --strip-components=1 \
&& ln -sf /usr/share/maven/bin/mvn /usr/bin/mvn
but when i use this in github actions for mvn test
It throws error:
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @Awslogin3016He ,
Check toochain.xml file if it contains the jdk path or not.
Thanks
Hi @Awslogin3016He ,
Check toochain.xml file if it contains the jdk path or not.
Thanks
Hi @Awslogin3016He
Please check if this helps : https://stackoverflow.com/questions/40354942/maven-build-error-after-setting-toolchain-right
@Awslogin3016He Did you find the suggestion helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you!
Views
Replies
Total Likes
Views
Likes
Replies