Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

wmoustafa
Copy link
Contributor

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.

@@ -20,5 +21,5 @@ dependencies {
}

artifacts {
archives jar, javadocJar, sourcesJar
archives jar
Copy link
Contributor

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

Copy link
Contributor Author

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.

Comment on lines +82 to +87
artifact(javadocJar) {
classifier = 'javadoc'
}
artifact(sourcesJar) {
classifier = 'sources'
}

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'

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.

Comment on lines 50 to 52
artifacts {
archives jar, javadocJar, sourcesJar
archives jar
}

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)

@mockitoguy
Copy link
Contributor

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.

@mockitoguy
Copy link
Contributor

Here's my suggestion how to move forward: #52

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.

4 participants