Skip to content

Before First Release

Mária Jurčovičová edited this page Oct 17, 2015 · 19 revisions

1. Compilation

Java linked by JAVA_HOME must be 7.x jdk:

> echo %java_home%
c:\Program Files\Java\jdk1.7.0_79\

Reason: Antlr3 does not work properly on Java 8 and returns an error. It does not affect generation, but maven would refuse to release it.

2. Pgp

  • Install gpg. My current gpg version is gpg (GnuPG) 1.4.19.
  • Either generate new key or add old one to keys list. The name and email must match first name, last name and email in maven central (sonatype). How to find them:
  • Log in.
  • Click on username in upper right corner.
  • Choose profile.
  • If you generated new key, upload it to MIT PGP Public Key Server.

3. Maven Version

Release process works with maven 3.3.3, e.g. mvn --version returns:

Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T13:57:37+02:00)
Maven home: c:\Program Files\apache-maven-3.3.3\bin\..
Java version: 1.7.0_79, vendor: Oracle Corporation
Java home: c:\Program Files\Java\jdk1.7.0_79\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"

4. Maven Central Access Token

Generate new access token in maven central (sonatype):

  • Log in.
  • Click on username in upper right corner and then profile.
  • Change Summary into User Token option in the main combo-box.
  • Click Access User Token.
  • Submit your sonatype username and password again.
  • The server will generate random looking username and password a.ka. access token. It looks somewhat like this:
<server>
  <id>${server name}</id>
  <username>du8998SS+-w</username>
  <password>hrm+-ioioi3344344kkkKKKKjgggg</password>
</server>

5. Maven Configuration

Configure maven to use newly generated access token:

  • Create settings.xml file in ${user.home}/.m2/settings.xml.
  • Add new sonatype-nexus-snapshots server into servers section and configure new access token as its username and password:
    <server>
      <id>sonatype-nexus-snapshots</id>
      <name>Sonatype Nexus snapshot repository</name>
      <username>du8998SS+-w</username>
      <password>hrm+-ioioi3344344kkkKKKKjgggg</password>
    </server>
  • Add new sonatype-nexus-staging server into servers section and configure new access token as its username and password:
    <server>
      <id>sonatype-nexus-staging</id>
      <name>Sonatype Nexus release repository</name>
      <username>du8998SS+-w</username>
      <password>hrm+-ioioi3344344kkkKKKKjgggg</password>
    </server>

Full settings.xml:

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">

  <pluginGroups>
  </pluginGroups>

  <proxies>
  </proxies>

  <servers>
    <server>
      <id>sonatype-nexus-snapshots</id>
      <name>Sonatype Nexus snapshot repository</name>
      <username>du8998SS+-w</username>
      <password>hrm+-ioioi3344344kkkKKKKjgggg</password>
    </server>
    <server>
      <id>sonatype-nexus-staging</id>
      <name>Sonatype Nexus release repository</name>
      <username>du8998SS+-w</username>
      <password>hrm+-ioioi3344344kkkKKKKjgggg</password>
    </server>
  </servers>
  <mirrors>
  </mirrors>
  <profiles>
  </profiles>
</settings>

6. Release Artifact

Continue at Release Process page.