Skip to content

[Build] Support publishing maven artifacts directly to maven central #2397

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

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

Conversation

breskeby
Copy link
Contributor

@breskeby breskeby commented Jun 4, 2025

Ensure we create an maven central publishing compliant aggregation zip for all elasticsearch hadoop files we want to publish

@breskeby breskeby changed the title [WIP] use nmcp plugin for publishing to maven central Support publishing maven artifacts directly to maven central Jun 5, 2025
@breskeby breskeby changed the title Support publishing maven artifacts directly to maven central [Build/Release] Support publishing maven artifacts directly to maven central Jun 5, 2025
@breskeby breskeby marked this pull request as ready for review June 6, 2025 08:48
project.tasks.withType(GenerateMavenPom).all { GenerateMavenPom pom ->
if (pom.name == "generatePomFileFor${publication.name.capitalize()}Publication") {
BasePluginExtension baseExtension = project.getExtensions().getByType(BasePluginExtension.class);
pom.destination = project.provider({"${project.buildDir}/distributions/${baseExtension.archivesName.get()}-${project.getVersion()}.pom"})
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this results in a deprecation warning and we would not want to rely on that workaround anymore.


defaultTasks 'build'

dependencies {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we explicitly list the artifacts we want to publish here to avoid any accidental publication

@@ -197,3 +198,15 @@ task generateDependenciesReport(type: ConcatFilesTask) { concatDepsTask ->
project.tasks.named('dependencyLicenses', DependencyLicensesTask) {
it.dependencies = project.configurations.licenseChecks
}


tasks.register('copyPoms', Copy) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

temporally we want to keep the build compatible with the existing DRA build. We can remove this workaround once we rely our releases on the new mechanism

@breskeby breskeby requested a review from a team June 6, 2025 08:56
@breskeby breskeby self-assigned this Jun 6, 2025
@breskeby breskeby changed the title [Build/Release] Support publishing maven artifacts directly to maven central [Build] Support publishing maven artifacts directly to maven central Jun 6, 2025
@breskeby breskeby requested a review from jozala June 6, 2025 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant