asciidoctor / asciidoclet

:clipboard: A Javadoc Doclet based on Asciidoctor that lets you write Javadoc in the AsciiDoc syntax.
https://github.com/asciidoctor/asciidoclet
Apache License 2.0
133 stars 40 forks source link

Publish to jcenter (bintary) #27

Closed mojavelinux closed 10 years ago

mojavelinux commented 10 years ago

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.

mojavelinux commented 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.

johncarl81 commented 10 years ago

I'm a little concerned this is outside of the scope for a Doclet... can you explain more @mojavelinux?

mojavelinux commented 10 years ago

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:

  1. Create a bintray account (we'll then add you to the Asciidoctor organization)
  2. 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>
  3. 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>
  4. Run 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.

mojavelinux commented 10 years ago

I'll setup the package for Asciidoclet in the Asciidoctor organization.

mojavelinux commented 10 years ago

https://bintray.com/asciidoctor/maven/asciidoclet/view

mojavelinux commented 10 years ago

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.

johncarl81 commented 10 years ago

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?

mojavelinux commented 10 years ago

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.

mojavelinux commented 10 years ago

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.

mojavelinux commented 10 years ago

Looks like the answer to the question is yes!

See http://veithen.blogspot.com/2013/05/github-bintray-maven-release-plugin.html

johncarl81 commented 10 years ago

Awesome. Lets get the remaining PRs resolved and we'll release!

mojavelinux commented 10 years ago

Excellent! I'm ready when you are!! If you don't see me around, feel free to ping me on Twitter.

johncarl81 commented 10 years ago

Success! And it was a breeze with the maven release plugin. Now, it looks like we need to setup syncing to maven central.

mojavelinux commented 10 years ago

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.

mojavelinux commented 10 years ago

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.

johncarl81 commented 10 years ago

hmm, I thought I had put in the request. Is there any indication that it is in process?

mojavelinux commented 10 years ago

We probably both did :) They don't have an indicator. I'll suggest that to them.

mojavelinux commented 10 years ago

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!

mojavelinux commented 10 years ago

We're good here, right?

johncarl81 commented 10 years ago

Yup, all done, worked like a charm.