Closed mojavelinux closed 10 years ago
Could we plan to make this part of the 1.5.0 release? You'll have tons of help on hand if you need it.
I'm a little concerned this is outside of the scope for a Doclet... can you explain more @mojavelinux?
Simply put, jcenter is the new, improved and secure Maven central. Tools like Gradle actually recommend jcenter over Maven Central...which is a reasonable switch since Gradle doesn't assume anything about remote repositories.
We are setting up bintray as the official binary destination for Asciidoctor bits. The upside is that bintray automatically puts artifacts into Maven Central, so we never have to worry about publishing directly to Maven Central again.
We've got the Gradle and Maven plugins there already. See https://bintray.com/asciidoctor/maven
Setting up is extremely simple. You just need to:
Add your API credentials to your ~/.m2/settings.xml
<server>
<id>bintray-asciidoctor-maven-asciidoclet</id>
<username>YOUR_BINTRAY_USERNAME</username>
<password>YOUR_BINTRAY_API_KEY</password>
</server>
Add the distributionManagement stanza at the bottom of your pom.xml
<distributionManagement>
<repository>
<id>bintray-asciidoctor-maven-asciidoclet</id>
<name>asciidoctor-maven-asciidoclet</name>
<url>https://api.bintray.com/maven/asciidoctor/maven/asciidoclet</url>
</repository>
</distributionManagement>
mvn deploy
That's it! We'll need to click a few more buttons in the UI to setup the sync, but after that it's automatic.
I'll setup the package for Asciidoclet in the Asciidoctor organization.
I'll leave it up to you whether you want to publish the artifact under your username namespace and link it to the asciidoctor organization (and jcenter) (like Andres is doing for the Gradle plugin) or you want to publish it under the asciidoctor namespace (like we're doing for the Maven plugin). I have reserved a space under the asciidoctor namespace, but I can delete that if necessary.
I understand.. I was thinking you had a different intention.
Yeah, of course we can take this route. Do you know if the mvn release plugin works with this?
I'm not sure, though I found that with a bit of config in the release profile, mvn deploy
works just fine. The only think it doesn't do is adjust the tags, but I just did that manually.
You can see the config I added in the Maven plugin...though several of the plugins I actually took from the Asciidoclet pom.xml. The only one I think you're missing is the gpg plugin if you want to sign the artifacts as part of the build.
Looks like the answer to the question is yes!
See http://veithen.blogspot.com/2013/05/github-bintray-maven-release-plugin.html
Awesome. Lets get the remaining PRs resolved and we'll release!
Excellent! I'm ready when you are!! If you don't see me around, feel free to ping me on Twitter.
Success! And it was a breeze with the maven release plugin. Now, it looks like we need to setup syncing to maven central.
Nice work!
To sync to Central, look for the link to publish to jCenter. Once that gets approved (should be very quick), then you can press another button to sync to Central. Then, you're all set.
(I'm going to talk to the JFrog guys about reducing this to one step).
Btw, if you could document the few steps to publish in the readme, that will help us remember in the future & other projects to follow your lead.
I went ahead and put in a request for entry into jCenter. Once that's approved, we'll be able to setup the sync.
Btw, Bintray also offers publishing of nightly snapshots. I put in a request to enable permissions for that. The details for how to do it are at http://oss.jfrog.org. I believe you can get the Travis build to publish snapshots, if that's something you want to do. Just, FYI.
hmm, I thought I had put in the request. Is there any indication that it is in process?
We probably both did :) They don't have an indicator. I'll suggest that to them.
The approval when through!
Now, just click on the "Maven Central" tab, enter your credentials and the sync will start.
Keep in mind that the password is not your Nexus OSS password, but rather your API token key. This page shows how to retrieve your key.
https://bintray.com/docs/uploads/uploads_syncingartifactswithmavencentral.html
Last step and we've got it!
We're good here, right?
Yup, all done, worked like a charm.
Publish to jcenter on Bintray. The goal is to get all Asciidoctor artifacts into jcenter, which provides a nice dashboard and repository for binary artifacts.
See AsciidoctorJ and the Asciidoctor Gradle plugin for examples on how to setup. It's pretty straightforward. I recommend that we follow the same approach of publishing to bintray under your own username, then clicking "Link to jcenter" to make it available in jcenter.