-
Notifications
You must be signed in to change notification settings - Fork 176
Tools release processing
For some smaller project in the Narayana "fleet" (narayana-checkstyle-config, narayana-openshift-tools) we started to use the Maven Release Plugin
to get the project released. This short article shows how to proceed and adds some context.
Before the release is done the project’s pom.xml
has to be prepared with several requirements.
The release plugin uses the <distributionManagement>
element to know where to deploy the artifacts and the <scm>
element to know where to push the tag
and the release changes in pom.xml
.
The scm
element contains several configuration sub-elements. The important one for the tagging and pushing is the developerConnection
which is used to push the pom.xml
changes during release:prepare
.
For the git implementation it’s good to use one via ssh connection. Then the push is automatic without asking the username/password as the ssh key is used. For example it could be like <developerConnection>scm:git:[email protected]:jbosstm/narayana-checkstyle-config.git</developerConnection>
.
<scm>
<scm>
<connection>scm:git:https://github.com/jbosstm/narayana-checkstyle-config.git</connection>
<url>https://github.com/jbosstm/narayana-checkstyle-config</url>
<developerConnection>scm:git:[email protected]:jbosstm/narayana-checkstyle-config.git</developerConnection>
<tag>HEAD</tag>
</scm>
This elements defines where to push the release when release:perform
is launched. We use the Red Hat Nexus instance. For an easy release it’s needed that the repository
id
in pom.xml
corresponds with configuration in ~/.m2/settings.xml
where the credentials to connect to the Nexus are saved.
<id>
<server>
<id>jboss-releases-repository</id>
<username>[username]</username>
<password>[password for jboss nexus connection]</password> <!-- same to developers.redhat.com -->
</server>
<distributionManagement>
<distributionManagement>
<repository>
<id>jboss-releases-repository</id>
<name>JBoss Release Repository</name>
<url>https://repository.jboss.org/nexus/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
The Red Hat nexus requires several elements for the released artifacts can be closed
and promoted
. The required elements are - besides others necessary for the mvn install
to work (see example).
-
<url>
-
<description>
-
<license>
-
<developer>
Note
|
Otherwise you can get errors when viewing the Nexus staging area like
|