settings.xml
Note: Listing the Apache servers in the settings.xml
file also requires adding the password to that file. Starting with Maven 2.1 this password may be encrypted and needs not be give in plaintext. Please refer to Password Encryption for more information.
In the past we staged release candidates on our local machines using a semi-manual process. Now that we inherit from the Apache parent POM version 6, a repository manager will automatically handle staging for you. This means you now only need to specify your GPG passphrase in the release profile of your $\{user.home\}/.m2/settings.xml
:
<settings>
...
<profiles>
<profile>
<id>apache-release</id>
<properties>
<gpg.passphrase> <!-- YOUR (encrypted) KEY PASSPHRASE --> </gpg.passphrase>
</properties>
</profile>
</profiles>
...
</settings>
Everything else has been configured in the latest Sling Parent POM:
<parent>
<groupId>org.apache.sling</groupId>
<artifactId>sling</artifactId>
<version>6</version>
</parent>
Some the release management steps can be further automated by using the Sling Commiter CLI Docker Image. The image is for now work-in-progress but has been used to drive multiple release. Please see the README file in the linked repository for usage details.
First prepare your POMs for release:
$ mvn release:prepare -DdryRun=true
Compare the original pom.xml
with the one called pom.xml.tag
to see if the license or any other info has been removed. This has been known to happen if the starting <project>
tag is not on a single line. The only things that should be different between these files are the <version>
and <scm>
elements. If there are any other changes, you must fix the original pom.xml
file and commit before proceeding with the release.
Publish a snapshot
$ mvn deploy
...
[INFO] [deploy:deploy]
[INFO] Retrieving previous build number from apache.snapshots.https
...
gpg --use-agent --armor --detach-sign --output $(mktemp) pom.xml
Prepare the release
$ mvn release:clean
$ mvn release:prepare
Stage the release for a vote
$ mvn release:perform
mvn release:prepare
and mvn release:perform
on other sub-projects as necessary on the same machine and they will be combined in the same staging repository - this is useful when making a release of multiple Sling modules.Close the staging repository:
Verify the staged artifacts
If perform fails for whatever reason (e.g. staged artifacts are incomplete or signed with a wrong key) drop the staging repository and create a required release.properties
file containing scm.url
and scm.tag
manually.
Example release.properties
file:
scm.url=scm:git:https://gitbox.apache.org/repos/asf/sling-org-apache-sling-settings.git
scm.tag=org.apache.sling.settings-1.3.10
Execute perform step again:
$ mvn release:perform
It may happen that deployment to Nexus fails or is partially successful. To fix such a deployment, you can re-deploy the artifacts from within the SCM checkout:
$ cd target/checkout
$ mvn deploy -Papache-release
Propose a vote on the dev list with the closed issues, the issues left, and the staging repository - for example:
To: "Sling Developers List" <dev@sling.apache.org>
Subject: [VOTE] Release Apache Sling ABC version X.Y.Z
Hi,
We solved N issues in this release:
https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12310710&version=[YOUR JIRA RELEASE VERSION ID]&styleName=Text
Staging repository:
https://repository.apache.org/content/repositories/orgapachesling-[YOUR REPOSITORY ID]/
You can use this UNIX script to download the release and verify the signatures:
https://raw.githubusercontent.com/apache/sling-tooling-release/master/check_staged_release.sh
Usage:
sh check_staged_release.sh [YOUR REPOSITORY ID] /tmp/sling-staging
Please vote to approve this release:
[ ] +1 Approve the release
[ ] 0 Don't care
[ ] -1 Don't release, because ...
This majority vote is open for at least 72 hours.
From Votes on Package Releases:
Votes on whether a package is ready to be released follow a format similar to majority approval -- except that the decision is officially determined solely by whether at least three +1 votes were registered. Releases may not be vetoed. Generally the community will table the vote to release if anyone identifies serious problems, but in most cases the ultimate decision, once three or more positive votes have been garnered, lies with the individual serving as release manager. The specifics of the process may vary from project to project, but the 'minimum of three +1 votes' rule is universal.
The list of binding voters is available on the Project Team page.
If the vote is successful, post the result to the dev list - for example:
To: "Sling Developers List" <dev@sling.apache.org>
Subject: [RESULT] [VOTE] Release Apache Sling ABC version X.Y.Z
Hi,
The vote has passed with the following result :
+1 (binding): <<list of names>>
+1 (non binding): <<list of names>>
I will copy this release to the Sling dist directory and
promote the artifacts to the central Maven repository.
Be sure to include all votes in the list and indicate which votes were binding. Consider -1 votes very carefully. While there is technically no veto on release votes, there may be reasons for people to vote -1. So sometimes it may be better to cancel a release when someone, especially a member of the PMC, votes -1.
If the vote is unsuccessful, you need to fix the issues and restart the process - see Canceling the Release. Note that any changes to the artifacts under vote require a restart of the process, no matter how trivial. When restarting a vote version numbers must not be reused, since binaries might have already been copied around.
If the vote is successful, you need to promote and distribute the release - see Promoting the Release.
If the vote fails, or you decide to redo the release:
git push --delete origin ${tagName}
)[CANCELLED]
to the subject lineIf the vote passes:
For the last two tasks, it's better to give the CDN some time to process the uploaded artifacts (15 minutes should be fine). This ensures that once the website (news and download page) is updated, people can actually download the artifacts.
It is possible to update the artifacts without needing to checkout or update the full dist folder, which can be quite slow, by using svn import
and svn delete
on the remote SVN repository.
Assuming that we are releasing org.apache.sling.engine 2.6.22
and the old version artifact names start with org.apache.sling.engine-2.6.20
, we can run the following commands
$ cd <folder where 2.6.22 is found>
$ svn import -m "Release org.apache.sling.engine-2.6.22" . https://dist.apache.org/repos/dist/release/sling
$ svn delete -m "Remove old version org.apache.sling.engine-2.6.20" $(svn ls https://dist.apache.org/repos/dist/release/sling/ | grep org.apache.sling.engine-2.6.20 | while read line; do echo "https://dist.apache.org/repos/dist/release/sling/$line"; done)
This makes sure that the new artifacts are imported and the old ones are deleted.
Go to Manage Versions section on the SLING JIRA and mark the X.Y.Z version as released setting the release date to the date the vote has been closed.
Also create a new version X.Y.Z+2, if that hasn't already been done.
And keep the versions sorted, so when adding a new version moved it down to just above the previous versions.
Close all issues associated with the released version.
If the new release should be included in the Sling Starter, please create PR after the artifacts are available on Maven Central. That usually happens within 60 minutes of the staging repository being closed.
If the released module was already included in the Sling Starter, a pull request will be generated by the renovate app, you can approve it as soon as the automated checks pass.
We usually do such announcements only for "important" releases, as opposed to small individual module releases which are just announced on our news page.
To: "Sling Developers List" <dev@sling.apache.org>, "Apache Announcements" <announce@apache.org>
Subject: [ANN] Apache Sling ABC version X.Y.Z Released
The Apache Sling team is pleased to announce the release of Apache Sling ABC version X.Y.Z
Apache Sling is a web framework that uses a Java Content Repository, such as Apache
Jackrabbit, to store and manage content. Sling applications use either scripts or
Java servlets, selected based on simple name conventions, to process HTTP requests
in a RESTful way.
<<insert short description of the sub-project>>
http://sling.apache.org/site/apache-sling-ABC.html
This release is available from http://sling.apache.org/site/downloads.cgi
Building from verified sources is recommended, but convenience binaries are
also available via Maven:
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.ABC</artifactId>
<version>X.Y.Z</version>
</dependency>
Release Notes:
<<insert release notes in text format from JIRA>>
Enjoy!
-The Sling team
Important: Add the release to the Software section of the next board report below Reports.
While the Sling IDE tooling is built using Maven, the toolchain that it is based around does not cooperate well with the maven-release-plugin. As such, the release preparation and execution are slightly different. Also note that we sign release using the Symantec code signing service, see Using the code signing service for details.
Before starting, it is recommended to run throught the Sling IDE Tooling release testing, to make sure no regressions have snuck in.
The whole process is outlined below, assuming that we start with a development version of 1.0.1-SNAPSHOT.
mvn tycho-versions:set-version -DnewVersion=1.0.2
git tag -a -m 'Tag 1.0.2 release' sling-ide-tooling-1.0.2
mvn tycho-versions:set-version -DnewVersion=1.0.3-SNAPSHOT
and also update the version of the source-bundle projectgit checkout sling-ide-tooling-1.0.2
p2update/pom.xml
, uncomment the codesign-maven-plugin
declaration and change the code signing service to Java Signing Sha256. Note that the process might fail during the code signing with a SAAJ error, retrying usually fixes it.mvn clean package -Pcodesign
cd p2update/target/repository-signed && zip -r org.apache.sling.ide.p2update-1.0.2.zip . && cd -
mvn clean package
sign.sh
scriptThe format of the release vote should be
To: "Sling Developers List" <dev@sling.apache.org>
Subject: [VOTE] Release Apache Sling IDE Tooling version X.Y.Z
Hi,
We solved N issues in this release:
https://issues.apache.org/jira/browse/SLING/fixforversion/
There are still some outstanding issues:
https://issues.apache.org/jira/browse/SLING/component/12320908
The release candidate has been uploaded at
https://dist.apache.org/repos/dist/dev/sling, The release artifact is
the source bundle - org.apache.sling.ide.source-bundle-X.Y.Z.zip -
which can be used to build the project using
mvn clean package
The resulting binaries can be installed into an Eclipse instance from
the update site which is found at p2update/target/repository after
building the project.
You can use this UNIX script to download the release and verify the signatures:
https://gitbox.apache.org/repos/asf?p=sling-ide-tooling.git;a=blob_plain;f=check_staged_release.sh;hb=HEAD
Usage:
sh check_staged_release.sh X.Y.Z /tmp/sling-staging
Please vote to approve this release:
[ ] +1 Approve the release
[ ] 0 Don't care
[ ] -1 Don't release, because ...
This majority vote is open for at least 72 hours
Once the release has passed, the following must be done:
ide-tooling/sign.sh
scriptecho "`date +%s`000"
Each Sling release must be signed, and the corresponding keys must be available at https://downloads.apache.org/sling/KEYS .
This page only provides minimal information, the canonical reference for this is the ASF Infrastructure Release Signing page.
Assuming you are using a *nix system with a working OpenSSH, GnuPG, and bash you can create and add your own key with the following commands:
Create a public/private pair key:
$ gpg --gen-key
When gpg asks for e-mail linked the key you MUST USE the <committer>@apache.org one. When gpg asks for comment linked the key you SHOULD USE "CODE SIGNING KEY"
Add your public key to https://downloads.apache.org/sling/KEYS by adding it via SVN to https://dist.apache.org/repos/dist/release/sling/KEYS. This is only possible for PMC members (for a reasoning look at http://www.apache.org/dev/release.html#upload-ci). If you are not a PMC member, please ask one to do the upload for you. The actual update can be achieved e.g. via
$ svn checkout https://dist.apache.org/repos/dist/release/sling/ sling --depth empty
$ cd sling
$ svn up KEYS
Add the public key to KEYS
file with your favourite editor and afterwards
$ svn commit -m "my key added" KEYS
When releasing a Maven plugin, the Maven-generated documentation published under http://sling.apache.org/components/ needs to be updated.
To publish the plugin documentation execute the following steps after the release:
Checkout the release tag of the released plugin (or reset your workspace)
Build the Maven site of the plugin locally.
$ mvn clean site:site
Checkout the Sling website
$ git clone https://github.com/apache/sling-site.git
Switch to branch asf-site
Replace the content of the existing folder components/<plugin-name>
with the generated Maven site from target/site
Create a new folder src/main/jbake/assets/components/<plugin-name>-archives/<plugin-name>-<version>
and copy the generated maven site there as well
Commit the changes
Check the results at http://sling.apache.org/components/