[Reference PR] Skip publishing to Bintray from Shipkit; publish to Maven Central instead#51
[Reference PR] Skip publishing to Bintray from Shipkit; publish to Maven Central instead#51wmoustafa wants to merge 1 commit intolinkedin:masterfrom
Conversation
|
|
||
| artifacts { | ||
| archives jar, javadocJar, sourcesJar | ||
| archives jar |
There was a problem hiding this comment.
Is there any reason to remove javadocJar and sourcesJar? There are needed to publish to maven central
There was a problem hiding this comment.
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.
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.
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.
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-publishplugin 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 publishToMavenLocalwhich 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.