question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Maven goal `spring-boot:build-image` runs package phase twice

See original GitHub issue

In 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:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
philwebbcommented, May 26, 2021

We’re going to investigate if we can add a no-fork option or variant.

0reactions
philwebbcommented, Jan 27, 2022

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found