Prerequisite
1. Use Genesis 2.0 as a parent pom
<parent> <groupId>org.apache.geronimo.genesis</groupId> <artifactId>genesis-java5-flava</artifactId> <version>2.0</version> </parent>
- genesis-java5-flava-2.0.pom
- genesis-default-flava-2.0.pom
- genesis-2.0.pom
- apache-6.pom
- genesis-2.0.pom
- genesis-default-flava-2.0.pom
2. Use Maven 2.2.1 (not try if 2.0.10 or 2.0.11 can run)
- Enable Apache Servers (refer: http://maven.apache.org/developers/committer-settings.html)
<settings> ... <servers> <!-- To publish a snapshot of some part of Maven --> <server> <id>apache.snapshots.https</id> <username> <!-- YOUR APACHE LDAP USERNAME --> </username> <password> <!-- YOUR APACHE LDAP PASSWORD --> </password> </server> <!-- To publish a website of some part of Maven --> <server> <id>apache.website</id> <username> <!-- YOUR APACHE LDAP USERNAME --> </username> <filePermissions>664</filePermissions> <directoryPermissions>775</directoryPermissions> </server> <!-- To stage a release of some part of Maven --> <server> <id>apache.releases.https</id> <username> <!-- YOUR APACHE LDAP USERNAME --> </username> <password> <!-- YOUR APACHE LDAP PASSWORD --> </password> </server> <!-- To stage a website of some part of Maven --> <server> <id>stagingSite</id> <!-- must match hard-coded repository identifier in site:stage-deploy --> <username> <!-- YOUR APACHE LDAP USERNAME --> </username> <filePermissions>664</filePermissions> <directoryPermissions>775</directoryPermissions> </server> ... </servers> </settings>
3. Setup PGP Keys (for the ones who be the release manager the first time, refer: http://maven.apache.org/developers/release/pmc-gpg-keys.html)
- Download pnugp2
- Generate your PGP Key (refer: http://www.apache.org/dev/openpgp.html)
- How To Avoid SHA-1
- How To Generate a Strong Key
- Append your key to https://svn.apache.org/repos/asf/geronimo/KEYS
- Update Maven's settings.xml with following:
<settings> ... <profiles> <profile> <id>apache-release</id> <properties> <gpg.passphrase> <!-- YOUR KEY PASSPHRASE --> </gpg.passphrase> </properties> </profile> </profiles> ... </settings>
Special changes for releasing the server 2.1.5
1. Add "all-subprojects" profile(Similar with what David Jencks did for 2.2)
By default, maven-release-plugin will use the default profile to search all the pom.xml files and auto-update the version numbers. But integration tests are often run from non-pom packaging projects, so We also need include them during the release plugin running. Hence we create a new "all-subprojects" profile:
- /pom.xml
This profile is just the same as default profile.<profile> <id>all-subprojects</id> <modules> <module>repository</module> <module>buildsupport</module> <module>testsupport</module> <module>framework</module> <module>plugins</module> <module>assemblies</module> <module>testsuite</module> </modules> </profile>
- /framework/configs/pom.xml
The config modules are all included by default, but the 4 integration test are not. So if we want this 4 projects' pom can be updated by maven-release-profile, we need explicitly point out.btw, I refactored the names of above 4 itest to make them the same with 2.2, i.e.<profile> <id>all-subprojects</id> <modules> <module>geronimo-gbean-deployer/src/it/j2ee-system-it1</module> <module>geronimo-gbean-deployer/src/it/j2ee-system-it2</module> <module>geronimo-gbean-deployer/src/it/metadatageneration-it3</module> <module>geronimo-gbean-deployer/src/it/metadatageneration-it4</module> </modules> </profile>
- j2ee-system -> j2ee-system-it1
- j2ee-system-2 -> j2ee-system-it2
- metadatageneration -> metadatageneration-it3
- metadatageneration-2 -> metadatageneration-it4
- /plugins/pom.xml (and some others do not need to add "all-subprojects" profile)
Not all the pom.xml must have an "all-subprojects" in file. If there is no special projects as above, you can just leave the pom as is (take /plugins/pom.xml as example). - /testsuite/pom.xml and its childern
A lot of efforts ware put on testsuite. When run with "all-subprojects" profile to do a release, we don't need really run and pass the tests. Remember the goal of this profile is just to find all the sub-projects' pom files so that release-plugin can auto update their versions. - prepare the release (-Dtest=false seems not take effect??)
mvn release:prepare -DdryRun=true -Pall-subprojects -Papache-release -Dtest=false
- Check if all pom.xml files have a pom.xml.tag generated
Compare the quantity of the 2 files - and if the versions in pom.xml.tag are updated correctly,
The only things that should be different between these files are the <version> and <scm> elements. - and if there is no "SNAPSHOT" in pom.xml.tag files.
Just find in files..
- Check if all pom.xml files have a pom.xml.tag generated
2. Don't deploy the test artifacts to maven repo
Because there are a lot of sub-projects that not need to be released, such as integration tests and testsuites, we need filter them out when do maven deploy:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-deploy-plugin</artifactId> <configuration> <skip>true</skip> </configuration> </plugin>
- /framework/configs/geronimo-gbean-deployer/src/it/j2ee-system-it1/pom.xml
- /framework/configs/geronimo-gbean-deployer/src/it/j2ee-system-it2/pom.xml
- /framework/configs/geronimo-gbean-deployer/src/it/metadatageneration-it3/pom.xml
- /framework/configs/geronimo-gbean-deployer/src/it/metadatageneration-it4/pom.xml
- /testsuite/pom.xml
3. Other changes
- Remove tools-maven-plugin and use the ianal-maven-plugin(defined in genesis-default-flava-2.0.pom) to verify-legal-files
- Add following in testsuite/pom.xml
<plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>ianal-maven-plugin</artifactId> <configuration> <!-- Don't bother checking legal file here, we never publish them. --> <skip>true</skip> </configuration> </plugin>
- Add following in testsuite/pom.xml
- Remove a bunch of maven plugins definition in server root pom
- Update xmlbeans-maven-plugin to 2.3.3 and remove all the following hacked codes:
<!-- HACK: Copy XmlBeans generated schemas. --> <plugin> <groupId>org.apache.geronimo.buildsupport</groupId> <artifactId>buildsupport-maven-plugin</artifactId> <executions> <execution> <goals> <goal>copy-xmlbeans-schemas</goal> </goals> </execution> </executions> </plugin>
Release memo
0. NOTICE.txt files
- Check the "Year" of copyright in all NOTICE.txt file.
1. Before release(Don't checkin!!)
- Update the @VERSION@ in README.txt / RELEASE_NOTES-2.1.5-SNAPSHOT.txt
- Update <version> properties from 2.1.5-SNAPSHOT to 2.1.5 in root pom.xml
2. After release:
- update artifact-alias
- Update <version> properties from 2.1.5-SNAPSHOT to 2.1.6-SNAPSHOT in root pom.xml