spring-boot: bootRepackage's jar rewriting defeats Gradle's up-to-date checks, causing unnecessary rebuilds
bootRepackage
overwrites build/libs/xxx.jar
, keeping the original jar as build/libs/xxx.jar.original
.
On the next build, Gradle will find that build/libs/xxx.jar
has been changed compared to what the previous run’s jar
task left, so it will assume that build/libs/xxx.jar
needs to be regenerated.
Possible solutions that I can see:
- Don’t overwrite
build/libs/xxx.jar
, generatebuild/libs/xxx.boot.jar
. (Please see #1112 for another issue that affects the naming code.) - Modify Gradle’s
jar
task so that it generates the uber jar right off the bat.
About this issue
- Original URL
- State: closed
- Created 10 years ago
- Reactions: 2
- Comments: 26 (12 by maintainers)
Commits related to this issue
- Add inputs to gradle bootRepackage task See gh-1113 — committed to spring-projects/spring-boot by deleted user 10 years ago
- Add dependencies to inputs in bootRepackge See gh-1113 — committed to spring-projects/spring-boot by deleted user 10 years ago
@philwebb changing default behavior of my building system isn’t exactly what I expect from spring plugin. Thanks for the link.
@bademux I don’t think it’s “pure evil” or a “really bad decision” and comments like this on a issues that’s been closed a year aren’t really constructive. Have you tried reading this section of the documentation which describes how you can use a Spring Boot application as a dependency?