Skip to content

Tools release processing

chalda edited this page May 5, 2021 · 5 revisions

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.

1) pom.xml preparation

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.

Configure scm

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>.

Example configuration of <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>

Configure distributionManagement

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.

settings.xml configuration with credentials and the <id>
<server>
  <id>jboss-releases-repository</id>
  <username>[username]</username>
  <password>[password for jboss nexus connection]</password> <!-- same to developers.redhat.com -->
</server>
Example configuration of <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>

Other necessary elements

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 failureMessage Invalid POM: /io/narayana/narayana-checkstyle-config/1.0.0.Final/narayana-checkstyle-config-1.0.0.Final.pom: Project description missing, Project URL missing, Developer information missing