Skip to content

Building a release with Maven

mrosoiu edited this page Dec 14, 2012 · 3 revisions

-- Draft --

These are the steps for building an XP Framework release with Maven. For the long version of this process, go here.

Prerequisites

  • JDK 6+ is installed on your command line path
$ java -version
  • Git is installed on your command line path
$ git --version
  • Maven 3.0.4+ is installed on your command line path
$ mvn --version
  • A GPG client is installed on your command line path
$ gpg --version
$ gpg --list-keys
$ gpg --list-secret-keys
  • Sonatype OSS Nexus entries are added to your settings.xml (~/.m2/settings.xml on Linux) as follow:
<settings>
  ...
  <servers>
    <server>
      <id>sonatype-nexus-snapshots</id>
      <username>xpadmin</username>
      <password>***</password>
    </server>
    <server>
      <id>sonatype-nexus-staging</id>
      <username>xpadmin</username>
      <password>***</password>
    </server>
  </servers>
  ...
</settings>

All XP Release Managers should have the password required for the xpadmin account on Sonatype OSS Nexus.

Steps to follow for building XP's core and tools modules

  1. Checkout the official xp-framework repository (not your fork, see foot notes) to a clean directory:
$ git clone [email protected]:xp-framework/xp-framework.git
  1. Update core/src/main/php/VERSION file with the actual version (possibly remove -dev). Commit the change (if the case) and push to GitHub.
  2. Go to the checkout root directory (containing the core and tools directories)
  3. Build and deploy the snapshots to make sure that the build is successful and the credentials for Sonatype OSS Nexus are correctly setup. This step is optional:
$ mvn deploy clean
  1. Prepare the release. You will be asked for the release version number and the next development cycle version (next SNAPSHOT version). You will also be asked for your GPG passphrase:
$ mvn release:prepare
  1. Perform the release. You will also be asked for your GPG passphrase:
$ mvn release:perform

At this point, the created artifacts are published to Sonatype OSS Nexus. Also a tag is created on GitHub and the repository is updated for the next development cycle:

Steps to follow for building XP's contrib modules

The contrib modules are stored in xp-framework/xp-contrib repository; the following modules should be built:

  • ecma
  • fpdf
  • google
  • ietf
  • imc
  • nsca
  • stomp

The rule here is: build all modules that carry the same version information as XP Framework's core.

For all these modules the steps are:

  1. Run mvn release:prepare
  2. Run mvn release:perform
In order for this to work, each module should have its own GitHub repo!

Sync artifacts with Maven Central Repository

To release the artifacts to Maven Central Repository, open your favorite browser and go to Sonatype OSS Nexus UI.

  1. Login to the Nexus UI using the same credentials as in ~/.m2/settings.xml
  2. Click "Staging Repositories" link from the left menu
  3. Select the "net.xp-framework" staging repository
Double-check the artifacts in this repository.
This is your last chance to make sure the artifacts are correctly built and packaged.
If you find that the artifacts are not ready to be deployed, click the "Drop" button from the menu above.
  1. Click the "Close" button from the menu above. Repository status should change from open to closed.
  2. Click the "Release" button from the menu above.
Once the artifacts are released, they will be synced to The Central Repository and you will
not be allowed to update or delete them!

Nexus UI

The sync to Maven Central Repository process runs roughly every 2 hours. You should see the artifacts deployed here: http://repo1.maven.org/maven2/net/xp-framework/

Notes

If you want to test this release process with your fork:

  1. Create a new test branch in your fork
  2. Change the <scm> information in the pom.xml to point to your fork, otherwise the changes in mvn release:perform will be pushed to the official repository (true story :)