-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Add classifier to version specific jar artifacts #121083
base: main
Are you sure you want to change the base?
Conversation
The mrjar plugin produces artifacts for each java version that may be consumed downstream. This commit fixes an issue with gradle dependencies when multiple java versions are depended on.
Pinging @elastic/es-delivery (Team:Delivery) |
@@ -163,6 +163,7 @@ private void addJar(Project project, SourceSet sourceSet, int javaVersion) { | |||
project.getConfigurations().register("java" + javaVersion); | |||
TaskProvider<Jar> jarTask = project.getTasks().register("java" + javaVersion + "Jar", Jar.class, task -> { | |||
task.from(sourceSet.getOutput()); | |||
task.getArchiveClassifier().set("java" + javaVersion); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know enough about how this works... will this select the newest applicable one, and default to java
if there are none?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this is about the output artifact name. Previously these different tasks for eg java 21 and 23 would create the same jar name. By adding a classifier, each is unique and won't overwrite each other.
The example plugin failure is unrelated, I opened #121089 to fix. |
@elasticmachine update branch |
The mrjar plugin produces artifacts for each java version that may be consumed downstream. This commit fixes an issue with gradle dependencies when multiple java versions are depended on.