[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
I'm trying to stage a final release of JAF.
First I tried "mvn -B ... deploy", but that failed with:
[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-gpg-plugin:1.1:sign (sign-artifacts) on project
all: Cannot obtain passphrase in batch mode -> [Help 1]
So I got rid of the "-B", but then it fails with:
[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-gpg-plugin:1.1:sign (sign-artifacts) on project
all: Execution sign-artifacts of goal
org.apache.maven.plugins:maven-gpg-plugin:1.1:sign failed.: NullPointerException
-> [Help 1]
My Jenkins job is:
https://jenkins.eclipse.org/jaf/job/jaf-branch-build-release/
I believe I've configured all the security stuff correctly, and I've
included the gpg workaround in my build script, which I've included below.
What did I do wrong?
-----
TOOLS_PREFIX='/opt/tools'
JAVA_PREFIX="${TOOLS_PREFIX}/java/oracle"
MVN_HOME="${TOOLS_PREFIX}/apache-maven/latest"
JAVA_HOME="${JAVA_PREFIX}/jdk-8/latest"
PATH="${MVN_HOME}/bin:${JAVA_HOME}/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
HELP_PLUGIN='org.apache.maven.plugins:maven-help-plugin:2.1.1'
# Customize these for each project
STAGING_NAME=jakartaactivation
STAGING_DESC="Eclipse Project for JAF"
STAGING_PROFILE_ID=70fc011e3d589e
# Workaround: GPG initialization
gpg --batch --import ${KEYRING}
for fpr in $(gpg --list-keys --with-colons | awk -F: '/fpr:/ {print $10}' |
sort -u);
do
echo -e "5\ny\n" | gpg --batch --command-fd 0 --expert --edit-key $fpr trust;
done
# XXX - just to make sure it doesn't change
mvn -B nexus-staging:rc-list-profiles
# Clean up from any previous failures
for id in $(mvn -B nexus-staging:rc-list | \
egrep "^\[INFO\] ${STAGING_NAME}\-[0-9]+[ ]+OPEN[ ]+${STAGING_DESC}" | \
awk '{print $2}')
do
echo "Closing and dropping $id"
mvn -B nexus-staging:rc-close nexus-staging:rc-drop \
-DstagingRepositoryId="$id" \
-DstagingDescription="${STAGING_DESC}"
done
# Open a new staging repo
mvn -B nexus-staging:rc-open \
-DstagingProfileId="${STAGING_PROFILE_ID}" \
-DstagingDescription="${STAGING_DESC}"
# Get the ID of the newly created staging repo
STAGING_REPO_ID=$(mvn -B nexus-staging:rc-list | \
egrep "^\[INFO\] ${STAGING_NAME}\-[0-9]+[ ]+OPEN[ ]+${STAGING_DESC}" | \
awk '{print $2}' | head -1)
# Build
mvn -B clean install
# Deploy
# Select the appropriate profile from our pom based on whether
# we're deploying a SNAPSHOT release or not.
VERSION=$(mvn -B ${HELP_PLUGIN}:evaluate \
-Dexpression=project.version 2> /dev/null | grep -v INFO)
case "$VERSION" in
*-SNAPSHOT)
PROFILE=deploy-snapshot
;;
*)
PROFILE=deploy-release
;;
esac
mvn -Poss-release -P"${PROFILE}" \
-DstagingRepositoryId="${STAGING_REPO_ID}" deploy
# Close the nexus staging repository
mvn -B nexus-staging:rc-close \
-DstagingRepositoryId="${STAGING_REPO_ID}" \
-DstagingDescription="${STAGING_DESC}"
# If it's a SNAPSHOT version, just release it.
case "$VERSION" in
*-SNAPSHOT)
mvn -B nexus-staging:rc-release \
-DstagingRepositoryId="${STAGING_REPO_ID}" \
-DstagingDescription="${STAGING_DESC}"
;;
esac