Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The hash of spring-boot-jarmode-layertools.jar that's added to a fat jar doesn't match the hash of the equivalent published artifact #31862

Closed
wilkinsona opened this issue Jul 26, 2022 · 1 comment
Assignees
Labels
type: bug A general bug
Milestone

Comments

@wilkinsona
Copy link
Member

wilkinsona commented Jul 26, 2022

The difference in the hash is due to two things:

  1. It has slightly different contents due to some exclusions
  2. The entry ordering and timestamps are different

The differences are caused by this configuration:

from {
zipTree(configurations.jarmode.incoming.files.singleFile).matching {
exclude "META-INF/LICENSE.txt"
exclude "META-INF/NOTICE.txt"
exclude "META-INF/spring-boot.properties"
}
}
reproducibleFileOrder = true
preserveFileTimestamps = false

I don't think the excludes are necessary as, unlike the loader, the layer tools are not unpacked. The reproducible ordering and timestamps are to improve cache hits and up-to-date checking at build time. We should either sacrifice those for the benefit of our users or we should apply the settings to the published artifact and then just use it as-is.

We may also want to consider a slightly larger change where we try to use Maven or Gradle to add the dependency to the app. This would mean that the jar was no longer embedded within spring-boot-loader-tools and we could just use the published artifact as-is. I think that would be relatively straightforward with Gradle. I'm not sure if it's possible with Maven.

@wilkinsona wilkinsona added the type: bug A general bug label Jul 26, 2022
@wilkinsona wilkinsona added this to the 2.6.x milestone Jul 26, 2022
@wilkinsona wilkinsona added the for: team-meeting An issue we'd like to discuss as a team to make progress label Jul 26, 2022
@bclozel bclozel removed the for: team-meeting An issue we'd like to discuss as a team to make progress label Jul 27, 2022
@wilkinsona
Copy link
Member Author

we should apply the settings to the published artifact and then just use it as-is

We've decided to take this approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants