For the convenience of Maven projects, Sonatype is providing a parent POM you can add to your project with all the basic configuration:
The important bits are:
<parent>
<groupId>org.sonatype.oss</groupId>
<artifactId>oss-parent</artifactId>
<version>7</version>
</parent>
And the source code repository details:
<scm>
<connection>scm:svn:http://foo.googlecode.com/svn/trunk/</connection>
<developerConnection>scm:svn:https://foo.googlecode.com/svn/trunk/</developerConnection>
<url>http://foo.googlecode.com/svn/trunk/</url>
</scm>
You will also need GPG to be install on your computer (Required to sign the packages) and our settings.xml
correctly filled with your credentials:
<servers>
<server>
<id>sonatype-nexus-snapshots</id>
<username>your-jira-id</username>
<password>your-jira-pwd</password>
</server>
<server>
<id>sonatype-nexus-staging</id>
<username>your-jira-id</username>
<password>your-jira-pwd</password>
</server>
</servers>
After that, you should be able to use the two steps release:
$ mvn release:prepare
$ mvn release:perform
Unfortunately, I don't know any way of automate the manual approval part of the process (In oss.sonatype.org). But that should already save you some times.
The documentation, as shown above, is probably a bit convoluted but is very complete and gives you all you need to know for various scenarios.
EDIT:
In fact I think I am wrong and there is a part on automate approval process. Interesting.
And for this part you are right, the details are quite limited. Though, I hope the first part of the configuration already helps you a little bit. I need to look further into this staging stuff (Or maybe someone else would have already done it !)
EDIT_AGAIN:
I need to actually try it but it would sound like something as follow:
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6</version>
<extensions>true</extensions>
<configuration>
<!-- The Base URL of Nexus instance where we want to stage -->
<nexusUrl>https://oss.sonatype.org/service/local/staging/deploy/maven2/</nexusUrl>
<serverId>sonatype-nexus-staging</serverId>
</configuration>
</plugin>
</plugins>
According to the documentation, the deploy should be replaced by the right staging workflow (Including the close) and it would left the latest step:
$ mvn nexus-staging:release -Ddescription="Yippie!"
TO BE TESTED...