-
Notifications
You must be signed in to change notification settings - Fork 14
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
Conversation
@ravisingal the build failed |
@@ -72,6 +72,7 @@ jobs: | |||
- docker_login | |||
- run: echo "Releasing version" && ./gradlew printVersion | |||
- run: ./gradlew publish | |||
- run: ./gradlew uploadArchives |
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 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) { |
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.
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.
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've followed the official documentation for this task: https://central.sonatype.org/pages/gradle.html
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.
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) { |
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.
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.
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.
we can try moving this out to individual sub-projects. I added here to avoid duplicates.
closing this in favor of #285 |
snapshot builds are available at: https://s01.oss.sonatype.org/content/repositories/snapshots/org/hypertrace/agent/