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

Add classifier to version specific jar artifacts #121083

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rjernst
Copy link
Member

@rjernst rjernst commented Jan 28, 2025

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.

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.
@rjernst rjernst added >non-issue :Delivery/Build Build or test infrastructure auto-backport Automatically create backport pull requests when merged v9.0.0 v8.18.0 labels Jan 28, 2025
@rjernst rjernst requested a review from a team as a code owner January 28, 2025 18:22
@elasticsearchmachine elasticsearchmachine added the Team:Delivery Meta label for Delivery team label Jan 28, 2025
@elasticsearchmachine
Copy link
Collaborator

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);
Copy link
Contributor

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?

Copy link
Member Author

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.

@rjernst
Copy link
Member Author

rjernst commented Jan 28, 2025

The example plugin failure is unrelated, I opened #121089 to fix.

@rjernst
Copy link
Member Author

rjernst commented Jan 30, 2025

@elasticmachine update branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Automatically create backport pull requests when merged :Delivery/Build Build or test infrastructure >non-issue Team:Delivery Meta label for Delivery team v8.19.0 v9.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants