-
Notifications
You must be signed in to change notification settings - Fork 187
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
[Reference PR] Skip publishing to Bintray from Shipkit; publish to Maven Central instead #51
Conversation
@@ -20,5 +21,5 @@ dependencies { | |||
} | |||
|
|||
artifacts { | |||
archives jar, javadocJar, sourcesJar | |||
archives jar |
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.
Is there any reason to remove javadocJar and sourcesJar? There are needed to publish 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.
Those types of jars are referenced in the main build.gradle
. Including them here was throwing an error. I verified that they existed in the local m2 repo after the local release step.
artifact(javadocJar) { | ||
classifier = 'javadoc' | ||
} | ||
artifact(sourcesJar) { | ||
classifier = 'sources' | ||
} |
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.
If your modules are all using the java
plugin, you should be able to use this block:
java {
withSourcesJar()
withJavadocJar()
}
in each of your modules (or in this file, outside the publications
block) and then source and javadoc jars will get added to the publication automatically since you're using from components.java
groupId = 'com.linkedin.coral' | ||
artifactId = subproject.name | ||
name = 'Coral' | ||
description = 'Coral is a SQL analysis, translation, and rewrite engine' |
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.
Up to you, but you might consider having the name and description describe what the actual artifact is. As a consumer, I find that to be a nicer use of name + description here.
artifacts { | ||
archives jar, javadocJar, sourcesJar | ||
archives jar | ||
} |
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 think you shouldn't need to add the jar
here either, since you're using from components.java
in your publications
block. The java
plugin should be adding that for you automatically (same comment for all the other modules)
We need to use "io.github.gradle-nexus.publish-plugin" plugin so that the publication to Maven Central is fully automatic, see example here: https://github.com/shipkit/shipkit-demo/blob/master/gradle/release.gradle#L20 Also, let's try to move off the deprecated Shipkit plugins. E.g. let's try to re-merge #36 I'll put some cycles on it. |
Here's my suggestion how to move forward: #52 |
Bintray is sunset starting 3/1/2021. This patch adapts Shipkit plugin integration so that it skips the Bintray publication step. Also, it sets up the
maven-publish
plugin so that it can publish to Maven Central. This patch is based on combining guides from Shipkit, OSSRH with Gradle and an example Maven Central + Gradle integration from dex-test-parser.This patch is tested by running
./gradlew publishToMavenLocal
which publishes artifacts locally. I found the expected artifacts in the local m2 repo, but did not notice he signing files. I will wait after check-in to see if they will be generated in the non-local publication case.The patch was also tested by running Shipkit's release in the dry run mode:
./gradlew performRelease -PdryRun
. It works all the way up to pushing. I did not provide a Github write token so that it does not accidentally push an undesired change.