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
- 167 LFX Mentorship
- 219 LFX Mentorship: Linux Kernel
- 795 Linux Foundation IT Professional Programs
- 355 Cloud Engineer IT Professional Program
- 179 Advanced Cloud Engineer IT Professional Program
- 82 DevOps Engineer IT Professional Program
- 127 Cloud Native Developer IT Professional Program
- 112 Express Training Courses
- 112 Express Courses - Discussion Forum
- 6.2K Training Courses
- 48 LFC110 Class Forum - Discontinued
- 17 LFC131 Class Forum
- 35 LFD102 Class Forum
- 227 LFD103 Class Forum
- 14 LFD110 Class Forum
- 39 LFD121 Class Forum
- 15 LFD133 Class Forum
- 7 LFD134 Class Forum
- 17 LFD137 Class Forum
- 63 LFD201 Class Forum
- 3 LFD210 Class Forum
- 5 LFD210-CN Class Forum
- 2 LFD213 Class Forum - Discontinued
- 128 LFD232 Class Forum - Discontinued
- 1 LFD233 Class Forum
- 2 LFD237 Class Forum
- 23 LFD254 Class Forum
- 697 LFD259 Class Forum
- 109 LFD272 Class Forum
- 3 LFD272-JP クラス フォーラム
- 10 LFD273 Class Forum
- 152 LFS101 Class Forum
- 1 LFS111 Class Forum
- 1 LFS112 Class Forum
- 1 LFS116 Class Forum
- 1 LFS118 Class Forum
- LFS120 Class Forum
- 7 LFS142 Class Forum
- 7 LFS144 Class Forum
- 3 LFS145 Class Forum
- 1 LFS146 Class Forum
- 3 LFS147 Class Forum
- 1 LFS148 Class Forum
- 15 LFS151 Class Forum
- 1 LFS157 Class Forum
- 33 LFS158 Class Forum
- 8 LFS162 Class Forum
- 1 LFS166 Class Forum
- 1 LFS167 Class Forum
- 3 LFS170 Class Forum
- 2 LFS171 Class Forum
- 1 LFS178 Class Forum
- 1 LFS180 Class Forum
- 1 LFS182 Class Forum
- 1 LFS183 Class Forum
- 29 LFS200 Class Forum
- 736 LFS201 Class Forum - Discontinued
- 2 LFS201-JP クラス フォーラム
- 14 LFS203 Class Forum
- 102 LFS207 Class Forum
- 1 LFS207-DE-Klassenforum
- 1 LFS207-JP クラス フォーラム
- 301 LFS211 Class Forum
- 55 LFS216 Class Forum
- 48 LFS241 Class Forum
- 42 LFS242 Class Forum
- 37 LFS243 Class Forum
- 15 LFS244 Class Forum
- LFS245 Class Forum
- LFS246 Class Forum
- 50 LFS250 Class Forum
- 1 LFS250-JP クラス フォーラム
- LFS251 Class Forum
- 154 LFS253 Class Forum
- LFS254 Class Forum
- LFS255 Class Forum
- 5 LFS256 Class Forum
- 1 LFS257 Class Forum
- 1.3K LFS258 Class Forum
- 10 LFS258-JP クラス フォーラム
- 111 LFS260 Class Forum
- 159 LFS261 Class Forum
- 41 LFS262 Class Forum
- 82 LFS263 Class Forum - Discontinued
- 15 LFS264 Class Forum - Discontinued
- 11 LFS266 Class Forum - Discontinued
- 20 LFS267 Class Forum
- 24 LFS268 Class Forum
- 29 LFS269 Class Forum
- 1 LFS270 Class Forum
- 199 LFS272 Class Forum
- 1 LFS272-JP クラス フォーラム
- LFS274 Class Forum
- 3 LFS281 Class Forum
- 9 LFW111 Class Forum
- 260 LFW211 Class Forum
- 182 LFW212 Class Forum
- 13 SKF100 Class Forum
- 1 SKF200 Class Forum
- 1 SKF201 Class Forum
- 782 Hardware
- 198 Drivers
- 68 I/O Devices
- 37 Monitors
- 96 Multimedia
- 174 Networking
- 91 Printers & Scanners
- 83 Storage
- 743 Linux Distributions
- 80 Debian
- 67 Fedora
- 15 Linux Mint
- 13 Mageia
- 23 openSUSE
- 143 Red Hat Enterprise
- 31 Slackware
- 13 SUSE Enterprise
- 348 Ubuntu
- 461 Linux System Administration
- 39 Cloud Computing
- 70 Command Line/Scripting
- Github systems admin projects
- 90 Linux Security
- 77 Network Management
- 101 System Management
- 46 Web Management
- 64 Mobile Computing
- 17 Android
- 34 Development
- 1.2K New to Linux
- 1K Getting Started with Linux
- 371 Off Topic
- 114 Introductions
- 174 Small Talk
- 19 Study Material
- 507 Programming and Development
- 285 Kernel Development
- 204 Software Development
- 1.8K Software
- 211 Applications
- 180 Command Line
- 3 Compiling/Installing
- 405 Games
- 309 Installation
- 97 All In Program
- 97 All In 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)