Section 5 Revision control with GIT - mvn build failed
Is anyone can provide the zip file generated by the start.spring.io page and share the exact mvn:alpine version? I do not know java, so rather than wasting time trying to understand why the build failed I wish I could get the same source and version used in the video.
Answers
-
Hi @bauger,
If you provide details about your environment (local, cloud, OS and version), the command you ran and the error you experienced, I may try to reproduce it.
Regards,
Luis.0 -
Hi Luis,
please see below. Thanks for your help.
Beatrice
- OS
$ uname -srm
Linux 4.19.0-18-amd64 x86_64
- Docker version
$ sudo docker version
Client: Docker Engine - Community
Version: 20.10.12
API version: 1.41
Go version: go1.16.12
Git commit: e91ed57
Built: Mon Dec 13 11:45:37 2021
OS/Arch: linux/amd64
Context: default
Experimental: trueServer: Docker Engine - Community
Engine:
Version: 20.10.12
API version: 1.41 (minimum version 1.12)
Go version: go1.16.12
Git commit: 459d0df
Built: Mon Dec 13 11:43:46 2021
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.4.12
GitCommit: 7b11cfaabd73bb80907dd23182b9347b4245eb5d
runc:
Version: 1.0.2
GitCommit: v1.0.2-0-g52b36a2
docker-init:
Version: 0.19.0
GitCommit: de40ad0maven:alpine image
https://hub.docker.com/layers/maven/library/maven/alpine/images/sha256-7445f83cd169b9f0b185e443e755ece1e37d3cf1e2e90f9180afad2fdb9d2bc4?context=explorecommand to build image:
$ sudo docker container run --rm -it -v m2:/root/.m2 -v /home/bea/Lecture/Learning/LinuxFoundation/DevOps_Bootcamp/LFS261/git/hellocd:/app maven:alpine mvn spring-boot:run -f app/pom.xml
and outputs:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------< com.example:hellocd >-------------------------
[INFO] Building hellocd 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] >>> spring-boot-maven-plugin:2.6.3:run (default-cli) > test-compile @ hellocd >>>
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) @ hellocd ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 1 resource
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ hellocd ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /app/target/classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.516 s
[INFO] Finished at: 2022-02-09T17:50:35Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project hellocd: Fatal error compiling: invalid target release: 11 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException0 -
Hi Beatrice,
Sorry for taking long in providing feedback, but it's not so easy to do the tests.
I was able to reproduce the issue on Ubuntu 20.04.4 LTS. What distro and version did you tried with?Regards,
Luis.0 -
Hi Luis,
thanks for taking time trying to reproduce the issue on your end. I'm running docker on Debian 4.19.208-1 (2021-09-29) x86_64 GNU/Linux.
I finally used another alpine version to be able to continue following the tutorial.
Béatrice
0 -
Hi Béatrice,
It's a pleasure! Can you tell me what Alpine version worked for you, please?
Thanks,
Luis.0 -
Hi Luis,
unfortunately this section is before the Jenkins introduction, so I do not have any script to check. And due to resources constraint I had to prune Docker images no longer used. I'm afraid I cannot trace back with alpine version I used for sure. But, in the following section where the Docker image is written in a Jenkinsfile I used the maven:3.6.1-jdk-8-alpine.
Thanks
Béatrice
0 -
Hi Béatrice,
Yep, the deployments are sensitive to different versions. We keep investigating in our end.
Regards,
Luis.0 -
Thanks for pitching in @luisviveropena . @bauger maven:3.8-openjdk-11-slim image tag works with the latest version of the code. I have updated the lab guide and should be published soon.
2 -
It's a pleasure, @gouravshah .
I have updated the lab guide and should be published soon.
Wonderful!
Luis.
0 -
Hi,
I'm also experiencing issues compiling the build. The solution is to use maven:3.8-openjdk-11 image?
attached the file with more details.executed:
$ docker container run --rm -it -v m2:/root/.m2 -v /home/admin/Documents/Bootcamp/DevOps_SRE/Git/hellocd:/app maven:alpine mvn spring-boot:run -f /app/pom.xml -XImage:
REPOSITORY TAG IMAGE ID CREATED SIZE
maven alpine 7445f83cd169 2 years ago 122MB0 -
I can confirm, it works with image maven:3.8-openjdk-11-slim , solution pointed by @gouravshah
@manuel.nhiuana said:
Hi,
I'm also experiencing issues compiling the build. The solution is to use maven:3.8-openjdk-11 image?
attached the file with more details.executed:
$ docker container run --rm -it -v m2:/root/.m2 -v /home/admin/Documents/Bootcamp/DevOps_SRE/Git/hellocd:/app maven:alpine mvn spring-boot:run -f /app/pom.xml -XImage:
REPOSITORY TAG IMAGE ID CREATED SIZE
maven alpine 7445f83cd169 2 years ago 122MB1 -
Hi @manuel.nhiuana , yes, maven:3.8-openjdk-11-slim is the version that Gourav tested and confirmed it's working

I'm glad it worked for you too.
Many regards,
Luis.2 -
Hello,
I encountered this build issue today as well (2022.12.13). I did find a fix for it. I decided to use OpenJDK-17 instead of OpenJDK-11 when creating the spring zip file, and then I used maven:3.8.5-openjdk-17-slim with docker. It worked after that.
I hope this might help anyone else too.
Thanks,
--
zak
0 -
Hi @zacts,
1.- Are you working with the updated course/content?
2.- What is the specific section on the chapter and the command that failed to you? So I can check on it.Regards,
Luis.0 -
Hello,
- I'm working through the PDF of Lab 3 for the ch on git in the DevOps and SRE Fundamentals course. I accessed this PDF as of Monday 2022.12.12.
- The specific section and commands that failed for me are Using Docker in Development
bash-$ docker container run --rm -it -v /absolute/path/to/hellocd:/app maven:3.8-openjdk-11-slim sh
bash-# mvn spring-boot:run -f app/pom.xml
after running the mvn spring-boot:run -f app/pom.xml the build fails with an error due to a version mismatch or something. I have to try it out again later today as I don't have my vm instance handy at the moment. The version mismatch seemed to want OpenJDK 17. So, my fix was to try to generate the zip file with OpenJDK-17 instead of OpenJDK-11 and then to use the corresponding dockerhub maven version for that. It did successfully complete the build for me after I did that.
Hi @zacts,
1.- Are you working with the updated course/content?
2.- What is the specific section on the chapter and the command that failed to you? So I can check on it.Regards,
Luis.0 -
I originally used Java-11 like in your post, but that was throwing a version mismatch error for me when I tried to build it. I switched to generating the zip file via Java-17 instead of Java-11 and then I used a more recent dockerhub maven with OpenJDK-17-slim instead of OpenJDK-11-slim and the build worked for me.
0 -
@zacts Thanks for catching this! It appears to be a mistake on Spring Boot's side. They updated the site a couple of weeks ago and appear to have mixed up their versions on accident. I have opened an issue with them on their GitHub but in the mean time you are fine completing the lab with the Java 17 image as you have discovered on your own. Wherever you see maven:3.8-openjdk-11-slim, replace it with maven:3.8-openjdk-17-slim. I will look into updating this in the course as soon as possible. Once again, thank you for catching this!
1
Categories
- All Categories
- 175 LFX Mentorship
- 175 LFX Mentorship: Linux Kernel
- 745 Linux Foundation IT Professional Programs
- 372 Cloud Engineer IT Professional Program
- 168 Advanced Cloud Engineer IT Professional Program
- 73 DevOps IT Professional Program - Discontinued
- 3 DevOps & GitOps IT Professional Program
- 98 Cloud Native Developer IT Professional Program
- 7.6K Training Courses & Learning Paths
- AI & ML Training
- Blockchain & Decentralized Identity Training
- 1 Cloud & Containers Training
- Cybersecurity Training
- DevOps & Site-Reliability Training
- Linux Kernel Development Training
- Networking Training
- Open Source Best Practice Training
- System Administration Training
- System Engineering Training
- Web & Application Development Training
- 2 LFD103-JP クラス フォーラム
- 4 LFD210-CN Class Forum
- 764 LFD259 Class Forum
- 681 LFS101 Class Forum
- 2 LFS158-JP クラス フォーラム
- 162 LFS207 Class Forum
- 3 LFS207-DE-Klassenforum
- 4 LFS207-JP クラス フォーラム
- 61 LFS241 Class Forum
- 52 LFS242 Class Forum
- 42 LFS243 Class Forum
- 19 LFS244 Class Forum
- 4 LFS250-JP クラス フォーラム
- 166 LFS253 Class Forum
- 1.4K LFS258 Class Forum
- 792 Hardware
- 202 Drivers
- 68 I/O Devices
- 37 Monitors
- 95 Multimedia
- 173 Networking
- 91 Printers & Scanners
- 87 Storage
- 768 Linux Distributions
- 81 Debian
- 67 Fedora
- 22 Linux Mint
- 13 Mageia
- 24 openSUSE
- 150 Red Hat Enterprise
- 31 Slackware
- 13 SUSE Enterprise
- 356 Ubuntu
- 465 Linux System Administration
- 31 Cloud Computing
- 73 Command Line/Scripting
- Github systems admin projects
- 98 Linux Security
- 78 Network Management
- 101 System Management
- 46 Web Management
- 106 Mobile Computing
- 18 Android
- 73 Development
- 1.2K New to Linux
- 1K Getting Started with Linux
- 392 Off Topic
- 121 Introductions
- 181 Small Talk
- 29 Study Material
- 945 Programming and Development
- 310 Kernel Development
- 617 Software Development
- 978 Software
- 370 Applications
- 182 Command Line
- 5 Compiling/Installing
- 68 Games
- 317 Installation
- Archived
- 2 LFD140 Class Forum
Upcoming Training
-
August 20, 2018
Kubernetes Administration (LFS458)
-
August 20, 2018
Linux System Administration (LFS301)
-
August 27, 2018
Open Source Virtualization (LFS462)
-
August 27, 2018
Linux Kernel Debugging and Security (LFD440)



