Skip to content

Publish jars to maven central repository #281

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

Closed
wants to merge 3 commits into from

Conversation

ravisingal
Copy link
Contributor

@pavolloffay
Copy link
Member

@ravisingal the build failed

@@ -72,6 +72,7 @@ jobs:
- docker_login
- run: echo "Releasing version" && ./gradlew printVersion
- run: ./gradlew publish
- run: ./gradlew uploadArchives
Copy link
Contributor

Choose a reason for hiding this comment

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

I thought we had migrated everything off circleci? I guess this repo was missed - would it make sense to migrate it before adding more circleci workflows?

@@ -69,5 +71,39 @@ subprojects {
junitXml.isOutputPerTestCase = true
}
}
"uploadArchives"(Upload::class) {
Copy link
Contributor

Choose a reason for hiding this comment

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

upload archives is the deprecated publishing mechanism - any reason we can't use the new one? For that matter, most of this looks like it's just changing the destination used by our regular publish plugin - can we use (or modify that)? This isn't the kind of stuff we want copied around repo to repo.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've followed the official documentation for this task: https://central.sonatype.org/pages/gradle.html

Copy link
Contributor

Choose a reason for hiding this comment

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

That's horribly outdated. The upload mechanism was deprecated way back in gradle 1 in 2014 - its remained for legacy support (probably this documentation 🙄 . There's not too much to using the new mechanism, I can help you out.

See example here: https://docs.gradle.org/current/userguide/publishing_maven.html#publishing_maven:complete_example

@@ -69,5 +71,39 @@ subprojects {
junitXml.isOutputPerTestCase = true
}
}
"uploadArchives"(Upload::class) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we intentionally uploading every subproject? Any way for them to opt out? Using subprojects is a big gradle antipattern because it makes it very hard to understand how projects are configuring and easy to mess up - that goes doubly for publishing - we don't want to add a new project and have it automatically start publishing to maven central.

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 can try moving this out to individual sub-projects. I added here to avoid duplicates.

@ravisingal
Copy link
Contributor Author

closing this in favor of #285

@ravisingal ravisingal closed this Mar 11, 2021
@pavolloffay pavolloffay deleted the publish-maven-central branch May 10, 2021 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants