Deploying to Maven Central
--------------------------

I'm writing this summary because I found the process of deploying to Maven to be quite complex.

This is a manual process, but allows JavaCC to avoid Maven builds.

Basically, Maven needs a POM file to describe a release, a jar file for the release itself, a jar file containing source, a jar file containing javadocs and all jarfiles must be contained in a master jar file where each jar file is hashed and signed.

Java.net has its own maven repository which syncs to the Maven Central service. To upload to the java.net repository, the uploader requires a private key.

Creating a Key Pair (One Time Process)
--------------------------------------

The guide for generating a key is located here : https://docs.sonatype.org/display/Repository/How+To+Generate+PGP+Signatures+With+Maven

You must have a public key generated by the following method:

   Windows Users
   -------------

   1) Install gnuPG
   2) Go to command line and type : gpg --gen-key
   3) Select default options, and select your own email address. You have the choice of creating a secret key or not. This is not mandatory.

Upload your public key to the server (One Time Process)
-------------------------------------------------------

1) Type "gpg --list-keys" at the command line
2) There should be some text returned such as "pub 1024D/C6EED57A 2010-01-13"
3) Type "gpg --keyserver hkp://pool.sks-keyservers.net --send-keys C6EED57A", where the C6EED57A argument should correspond to the C6EED57A area in the line of text returned by section 2.

Deploying a new release to Maven Central (via java.net Nexus repository)
------------------------------------------------------------------------

** Sorry about steps 1 and 2, it just wasn't worth automating.

1) Edit /make_bundle.sh  (in the project root folder) to change the version number to the version number in version.props.
2) Go to 'deployment_pom' folder, and edit the POM file to match the version in the version.props file.
3) Run make_bundle.sh
4) Navigate to https://maven.java.net/index.html#staging-upload
5) Select bundle.jar and upload.
6) Search for 'javacc' in the java.net Nexus repository.
7) Select the staged release, and select 'release'.
8) The release will appear in maven central in a few hours.


Author : Chris Ainsley , 2014/05/04