-
Notifications
You must be signed in to change notification settings - Fork 0
Building a release with Maven
-- Draft --
These are the steps for building an XP Framework release with Maven. For the long version of this process, go here.
- 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
- You have created your GPG keys and distributed your public key to
hkp://pool.sks-keyservers.net/
. For more information, please refer to How To Generate PGP Signatures With Maven.
$ 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.
- 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
- Update
core/src/main/php/VERSION
file with the actual version (possibly remove-dev
). Commit the change (if the case) and push to GitHub. - Go to the checkout root directory (containing the
core
andtools
directories) - 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
- 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
- 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:
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:
- Run
mvn release:prepare
- Run
mvn release:perform
In order for this to work, each module should have its own GitHub repo!
To release the artifacts to Maven Central Repository, open your favorite browser and go to Sonatype OSS Nexus UI.
- Login to the Nexus UI using the same credentials as in
~/.m2/settings.xml
- Click "Staging Repositories" link from the left menu
- 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.
- Click the "Close" button from the menu above. Repository status should change from
open
toclosed
. - 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!
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/
If you want to test this release process with your fork:
- Create a new test branch in your fork
- Change the
<scm>
information in thepom.xml
to point to your fork, otherwise the changes inmvn release:perform
will be pushed to the official repository (true story :)