...
So you need to have created a PGP (or GPG) key pair, which will be used in signing the release artifacts. For more information on using the Maven GPG plugin, see this introduction from Sonatype and the Maven GPG Plugin usage page. You may also want to run gpg-agent in order to avoid being prompted multiple times for the GPG key passphrase when performing a release.
Update maven Settings.xml File to authenticate scm servers
Preparations
Install git
Code Block sudo apt-get update sudo apt-get install git -y
Install maven3
Code Block sudo apt-add-repository ppa:andrei-pozolotin/maven3 sudo apt-get update sudo apt-get install maven3 -y # sudo vi /etc/profile export M2_HOME=/usr/share/maven3 export PATH=$PATH:$M2_HOME/bin source /etc/profile
Install gpg-agent
Code Block sudo apt-get install gnupg-agent -y # vi ~/.bashrc if test -f $HOME/.gpg-agent-info && \ kill -0 `cut -d: -f 2 $HOME/.gpg-agent-info` 2>/dev/null; then GPG_AGENT_INFO=`cat $HOME/.gpg-agent-info | cut -c 16-` else # No, gpg-agent not available; start gpg-agent eval `gpg-agent --daemon --no-grab --write-env-file $HOME/.gpg-agent-info` fi export GPG_TTY=`tty` export GPG_AGENT_INFO # exit and login again
Import gpg keys
Code Block # import or generate your gpg key ## import gpg --import XXX.asc ## generate gpg --full-generate-key # trust the key gpg --edit-key XXX trust 5 y quit
Install jdk8
Code Block sudo mkdir /apache && sudo chmod 777 /apache cd /apache wget --no-cookies --no-check-certificate --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz -O jdk8-linux-x64.tar.gz tar -xvzf jdk8-linux-x64.tar.gz ln -s jdk1.8.0_131 jdk # sudo vi /etc/profile export JAVA_HOME=/apache/jdk export PATH=$JAVA_HOME/bin:$PATH source /etc/profile # sudo vi $M2_HOME/bin/mvn JAVA_HOME=/apache/jdk
Install svn
Code Block sudo apt-get install subversion -y mkdir ~/svn
Update maven Settings.xml File to authenticate scm servers
Code Block | ||
---|---|---|
| ||
<?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"
xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<servers>
<!-- To publish a snapshot of some part of Maven -->
<server>
<id>apache.snapshots.https</id>
<username>USERNAME</username>
<password>PASSWORD</password>
</server>
<!-- To stage a release -->
<server>
<id>apache.staging.https</id>
<username>USERNAME</username>
<password>PASSWORD</password>
</server>
<!-- To stage a release of some part of Maven -->
<server>
<id>apache.releases.https</id>
<username>USERNAME</username>
<password>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 --> | ||
Code Block | ||
| ||
<?xml version="1.0" encoding="UTF-8"?> <settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <servers> <server> <id>apache.snapshots.https</id><username>USERNAME</username> <username>USERNAME<<filePermissions>664</username>filePermissions> <password>PASSWORD<<directoryPermissions>775</password>directoryPermissions> </server> <server> <server> <id>gpg.passphrase</id> <id>apache.releases.https</id><passphrase>GPG_PASSWORD</passphrase> </server> <username>USERNAME< </username>servers> </settings> |
Release Repository Preparation
Pull repository
Code Block mkdir ~/git && cd ~/git git
...
clone https://github.com/apache/griffin.git cd griffin git remote add apache-git https://git-wip-us.apache.org/repos/asf/griffin.git
Compile the project
Code Block maven clean install
Update Change Log
- Cleanup JIRA so the Fix Version in issues resolved since the last release includes this release version correctly.
- Update the CHANGELOG based on the Text release reports from JIRA.
- Review and update README.md if needed.
- Commit any changes back to git
- Stage any Roadmap or Release landing pages on the site.
...
Code Block | ||
---|---|---|
| ||
git checkout master git pull git checkout -b griffin-x.x.x-incubating-rcX |
Check license
Code Block | ||
---|---|---|
| ||
mvn -Papache-release clean apache-rat:check -e -DskipTests |
...
Code Block | ||
---|---|---|
| ||
version=x.x.x-incubating
tag=griffin-$version
mvn -Papache-release release:prepare -DautoVersionSubmodules=true -DdryRun=true -Dtag=$tag -DreleaseVersion=$version |
...
Code Block | ||
---|---|---|
| ||
mvn -Papache-release release:clean |
...
Prepare for release
Code Block | ||
---|---|---|
| ||
mvn -Papache-release -U clean release:prepare -DautoVersionSubmodules=true -Dtag=$tag -DreleaseVersion=$version |
...