-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Add option for spring-boot-maven-plugin:repackage goal to always generate filenames using group and artifact name #29390
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
Comments
Maven's war plugin provides an If we make this possible with Maven, we should also consider what, if anything, we want to do for Gradle. It's already possible with Gradle without any changes to Boot with some configuration like this: tasks.named('bootJar') {
rootSpec.rename { fileInJar ->
def artifact = project.configurations.runtimeClasspath.resolvedConfiguration.resolvedArtifacts.find { it.file.name == fileInJar }
return artifact ? "${artifact.moduleVersion.id.group}-${fileInJar}" : fileInJar
}
} It assumes that everything in tasks.named('bootJar') {
outputFileNameMapping = "${groupId}-${artifactId}-${version}.${ext}"
} Given the above, I don't think this issue is ideal for contribution. We need to make some design decisions before it can progress. |
The spring-boot-maven-plugin:repackage goal is using the pattern artifactId-baseVersion-classifier.extension. The classifier is optional. The groupId is prepended in case of duplicates of a dependency. However, a custom mapping like it is available in https://maven.apache.org/plugins/maven-war-plugin/examples/file-name-mapping.html is not available. This commit adds this feature. See issue: spring-projects#29390
@wilkinsona I created a fork and implemented the mapping as you described in your comment from 14 Feb. 2022 |
@zarembo Thanks for taking a look but, as I said above when describing the status of this issue, "we need to make some design decisions before it can progress". We haven't done that design work and, unfortunately, until we have, it won't be possible to review any possible contributions. One thing I can say is that any change in this area will only be added to a new 3.x minor release at the earliest. |
I fully understand your answer. A feature should never be a fast shot. But may I ask if a design discussion might be something in near future? The last activity is almost an year old. |
I think that's unlikely I'm afraid. This issue isn't particularly high priority as very few people appear to be affected by it and we have plenty of other higher priority things on our plate at the moment. |
well, it is not great, but this is how it works. 😞 |
When packaging two dependencies with same artifact name + version (but different groupID) the spring-boot-maven-plugin:repackage goal already adds the groupID to the packaged filename (see ArtifactsLibraries.java:doWithLibraries()
For better traceability within the produced fat-jar I'd like to have an option in the repackage configuration to force the inclusion of full GAV for all artifacts. Otherwise (badly named) artifacts with common names like
core
common
are not immediately obvious.The text was updated successfully, but these errors were encountered: