Skip to content

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)

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

@rjernst rjernst enabled auto-merge (squash) February 4, 2025 18:36
@rjernst rjernst merged commit 21218c3 into elastic:main Feb 4, 2025
18 checks passed
rjernst added a commit to rjernst/elasticsearch that referenced this pull request Feb 4, 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.
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
9.0

@rjernst rjernst deleted the mrjar/jar_task_classifier branch February 5, 2025 14:18
elasticsearchmachine pushed a commit that referenced this pull request Feb 5, 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.

Co-authored-by: Elastic Machine <[email protected]>
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.18.1 v8.19.0 v9.0.0 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants