Skip to content
Aled Sage edited this page May 19, 2015 · 18 revisions

note: instructions are based on https://brooklyn.incubator.apache.org/v/0.7.0-M1/dev/tips/release.html

winrm4j is released under the Apache 2 license, to maven central.

winrm4j is published to two locations:

  • Sonatype, for snapshots and for staging releases
  • Maven Central, for full (GA and milestone) releases

winrm4j artifacts are generally downloaded from:

  1. Maven Central,
  2. Sonatype,
  3. GitHub.

To publish:

  • a snapshot release:
    • mvn deploy to Sonatype
  • a (milestone) release:
    • same as above, but with some git versioning
    • deploy to Sonatype, then release to Maven Central
  • a GA release:
    • same as above, and
    • bump the snapshot version in brooklyn master to the next release

Configuration

Your .m2/settings.xml must be configured with the right credentials for Sonatype

    <servers>
    ...
            <server>
                    <username> ... </username>
                    <password> ... </password>
                    <id>sonatype-nexus-snapshots</id>
            </server>
            <server>
                    <username> ... </username>
                    <password> ... </password>
                    <id>sonatype-nexus-staging</id>
            </server>
    ...
    </servers>

You must be configured to sign artifacts using PGP.

If this is the first time you have used Sonatype, the Sonatype - Maven Usage Guide is required reading.

Releasing

The code snippets below use the following variables:

export WINRM4J_DIR=/path/to/winrm4j
export SNAPSHOT_VERSION=0.1.0-SNAPSHOT
export RELEASE_VERSION=0.1.0
export RELEASE_BRANCH_NAME=0.1.x
export NEXT_RELEASE_BRANCH_SNAPSHOT_VERSION=0.1.1-SNAPSHOT
export NEXT_MASTER_SNAPSHOT_VERSION=0.2.0-SNAPSHOT

It assumes that git is configured with upstream, and that direct access to winrm4j is permitted:

git remote add upstream https://github.com/cloudsoft/winrm4j.git

Deploy Snapshot to Sonatype

Follow these steps when the $WINRM4J_DIR/pom.xml's version has suffix -SNAPSHOT.

Execute the following:

mvn -Dgpg.passphrase="<your passphrase>" -DdeployTo=sonatype -DskipTests clean install deploy

Deploy (Milestone) Release

Prepare a Release Branch

cd $WINRM4J_DIR
git checkout -b $RELEASE_VERSION
# manually change the version
vi pom.xml
git commit -a -m "Changed version to $RELEASE_VERSION"
git push -u upstream $RELEASE_VERSION

Deploy to Sonatype, and Close the repo.

mvn -Dgpg.passphrase="<your passphrase>" -DdeployTo=sonatype -DskipTests clean install deploy

Deploy to Maven Central

Bump version numbers

Create a branch for maintenance releases (e.g. 0.1.x):

cd $WINRM4J_DIR
git checkout $RELEASE_VERSION
git checkout -b $RELEASE_BRANCH_NAME
# manually change the pom version to $NEXT_RELEASE_BRANCH_SNAPSHOT_VERSION
vi pom.xml
git commit -a -m "Changed version to $NEXT_RELEASE_BRANCH_SNAPSHOT_VERSION"
git push -u upstream $RELEASE_BRANCH_NAME

Increment the version number in master:

cd $WINRM4J_DIR
git checkout $MASTER
# manually change the pom version to $NEXT_MASTER_SNAPSHOT_VERSION
vi pom.xml
git commit -a -m "Changed version to $NEXT_MASTER_SNAPSHOT_VERSION"
git push

Clone this wiki locally