Maven goal `spring-boot:build-image` runs package phase twice
See original GitHub issueIn my project I have the front-end part in the same codebase. Consequently, I have a couple of calls to exec-maven-plugin
to build the front-end. And as a very last step, I have build-image
goal execution.
For some reason build-image
triggers execution of the whole build cycle again:
...
[INFO] >>> spring-boot-maven-plugin:2.4.5:build-image (default) > package @ spring-boot-build-image-double-build >>>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ spring-boot-build-image-double-build ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ spring-boot-build-image-double-build ---
[INFO]
...
The following project can be used to reproduce the problem: https://github.com/alexey-anufriev/spring-boot-build-image-double-build
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:7 (4 by maintainers)
Top Results From Across the Web
What is the reason that the spring-boot ... - Stack Overflow
The reason why most of the lifecycle is being run twice, is because the "build-image" goal in Spring Boot Maven plugin requires the...
Read more >Spring Boot Maven Plugin Documentation
It allows you to package executable jar or war archives, run Spring Boot applications, generate build information and start your Spring Boot ...
Read more >What is the reason that the spring-boot-maven-plugin reruns a ...
The reason why most of the lifecycle is being run twice, is because the "build-image" goal in Spring Boot Maven plugin requires the...
Read more >Difference Between spring-boot:repackage and Maven package
However, the Spring Boot Maven Plugin ships with a repackage goal, and it's called in an mvn command as well. Sometimes, the two...
Read more >A Hitchhiker's Guide to Containerizing (Spring Boot) Java Apps
COPY src src RUN ./mvnw package -DskipTests EXPOSE 8080 ENTRYPOINT ["java", "-jar", "target/spring-in-docker-1.0.jar"].
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
We’re going to investigate if we can add a
no-fork
option or variant.@martijndebruijn The issue is in the
2.x
milestone which means it’s something we’d like to fix with Spring Boot 2, but we don’t have a more specific milestone. We can’t really say when it will be solved I’m afraid. We do tend to prioritize issues If they get a pull-request from the community.