I have released my first Maven artifacts to the Central Repository through Sonatype’s Open Source Nexus Server.
You have to jump through some hoops to get everything just right to be able to release to the Sonatype Nexus repository, and I could not find all the information I needed in one place so I will document what I had trouble with here.
I followed these instructions and I had no trouble on Linux or OSX with getting anything to work, Windows 7 was a different story.
First thing I had trouble with on Windows 7 was getting GPG setup to sign my artifacts. I am using the GitBash shell that comes with the Git distribution for Windows. It doesn’t have everything you need to work with gpg as per the Sonatype Blog instructions. What I had to do was download the Windows installer for GPG from GnuPG.org
Then I copied all the
iconv.dll files from
C:\Program Files (x86)\GNU\GnuPG into
C:\Program Files (x86)\Git\bin. These were the default installation locations for each of these packages, your locations may differ if you put them somewhere else.
The one other thing is I had a hard time getting the gpg goal to fire and sign all my artifacts when using the
maven-release-plugin. I ended up with the following command line that did the trick.
mvn clean package verify release:preform -Darguments=-Dgpg.passphrase=PASSPHRASE