`spring-boot:build-image` hangs on multi-module project
See original GitHub issueRunning mvn spring-boot:build-image
at the root of a multi-module maven project hangs forever.
Sample project there: git@github.com:ch4mpy/lifix.git
Last logs output:
[INFO] --- spring-boot-maven-plugin:2.5.3:build-image (default-cli) @ common-storage ---
[INFO] Building image 'docker.io/library/common-storage:0.0.1-SNAPSHOT'
[INFO]
[INFO] > Pulling builder image 'docker.io/paketobuildpacks/builder:base' 100%
[INFO] > Pulled builder image 'paketobuildpacks/builder@sha256:4fae5e2abab118ca9a37bf94ab42aa17fef7c306296b0364f5a0e176702ab5cb'
[INFO] > Pulling run image 'docker.io/paketobuildpacks/run:base-cnb' 100%
[INFO] > Pulled run image 'paketobuildpacks/run@sha256:a285e73bc3697bc58c228b22938bc81e9b11700e087fd9d44da5f42f14861812'
[INFO] > Executing lifecycle version v0.11.4
[INFO] > Using build cache volume 'pack-cache-382e7345203f.build'
[INFO]
[INFO] > Running creator
and then nothing for more than 1/2 hour.
I Also tried to run
mvn package -Pnative
mvn clean install
and thenmvn spring-boot:build-image -pl faults-endpoints
(wherefaults-endpoints
is a spring-boot app for which I’d like to have a native image).
Both of the later fail, but with following error message, which make me think it’s a distinct issue:
[INFO] [creator] Error: Error parsing dynamic proxy configuration in file:/workspace/META-INF/native-image/org.springframework.aot/spring-aot/proxy-config.json:
[INFO] [creator] java.lang.IllegalArgumentException: repeated interface: org.springframework.aop.SpringProxy
[INFO] [creator] Verify that the configuration matches the schema described in the -H:PrintFlags=+ output for option DynamicProxyConfigurationResources.
[INFO] [creator] Error: Use -H:+ReportExceptionStackTraces to print stacktrace of underlying exception
[INFO] [creator] Error: Image build request failed with exit status 1
[INFO] [creator] unable to invoke layer creator
[INFO] [creator] unable to contribute native-image layer
[INFO] [creator] error running build
[INFO] [creator] exit status 1
[INFO] [creator] ERROR: failed to build: exit status 1
My point here is: shouldn’t mvn spring-boot:build-image
at root of multi-module project ignore non-application modules ? (or at least exit with error message)
Issue Analytics
- State:
- Created 2 years ago
- Comments:9
Top Results From Across the Web
spring-boot fails on multi-module app - Stack Overflow
I used this to run single spring boot web app. Then I add there new parent pom and another module. And after that...
Read more >Containerizing Maven/Gradle based Multi Module Spring Boot ...
A detailed step by step guide to Containerize Maven/Gradle based Multi Module Spring Boot Microservices using Docker & Kubernetes.
Read more >Docker buildx hangs when building image for arm64 using ...
Coding example for the question Docker buildx hangs when building image for arm64 using multi-stage Java build-Springboot.
Read more >Spring Native documentation
The easiest way to start a new native Spring Boot project is to go to ... in multi modules projects or when using...
Read more >Developer Documentation
Single and Multi module projects ... Spring Boot Migrator (SBM) aims to help developers migrating applications to Spring Boot, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks @scottfrederick, I am closing this issue on Spring Native side since you have created one on Spring Boot side.
@ch4mpy The
repackage
andbuild-image
goals are configured in very much the same way. Both bind to thepackage
phase by default, and the Spring Boot plugin must be activate for either to do anything. The only real difference is thatrepackage
is activated by default when usingspring-boot-starter-parent
as a Maven parent project (as mentioned in the documentation), butbuild-image
is not activated by default.You can get the outcome you’re describing by configuring your build as suggested above. Add
spring-boot-maven-plugin
to all modules so they get repackaged, and only add thebuild-image
execution in modules that you want an OCI image for. You’ll need to do the appropriate configuration ofspring-boot-maven-plugin
in each module to make that work. Thespring-boot-maven-plugin
andspring-aot-maven-plugin
do not and should not know about each other as they serve different purposes, so one plugin won’t influence the behavior of the other.