Make travis to use maven wrapper, too

refs #377
This commit is contained in:
Andreas Dangel
2017-05-05 11:17:25 +02:00
parent 88a8d44f97
commit aba44a8824
9 changed files with 18 additions and 28 deletions

View File

@ -9,9 +9,7 @@ language: java
jdk: oraclejdk8
before_install:
- bash .travis/setup-secrets.sh
- bash .travis/install-configure-maven.sh
- export M2_HOME=$HOME/apache-maven-3.3.9
- export PATH=$HOME/apache-maven-3.3.9/bin:${PATH}
- bash .travis/configure-maven.sh
install: true
before_script: true
script:

View File

@ -1,3 +1,3 @@
#!/bin/bash
set -ev
mvn verify -B -V
./mvnw verify -B -V

View File

@ -1,18 +1,18 @@
#!/bin/bash
set -ev
VERSION=$(mvn -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.5.0:exec)
VERSION=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.5.0:exec)
echo "Building PMD ${VERSION} on branch ${TRAVIS_BRANCH}"
if [[ "$VERSION" != *-SNAPSHOT && "$TRAVIS_TAG" != "" ]]; then
# release build
mvn deploy -Possrh,pmd-release -B -V
./mvnw deploy -Possrh,pmd-release -B -V
elif [[ "$VERSION" == *-SNAPSHOT ]]; then
# snapshot build
mvn deploy -Possrh -B -V
./mvnw deploy -Possrh -B -V
else
# other build. Can happen during release: the commit with a non snapshot version is built, but not from the tag.
mvn verify -Possrh -B -V
./mvnw verify -Possrh -B -V
# we stop here - no need to execute further steps
exit 0
fi

View File

@ -8,7 +8,7 @@ export PING_PID_FILE=/tmp/build-site-ping.pid
source .travis/background-job-funcs.sh
# Run the build, redirect output into the file
mvn site site:stage -Psite -B -V >> $BUILD_OUTPUT 2>&1
./mvnw site site:stage -Psite -B -V >> $BUILD_OUTPUT 2>&1
# The build finished without returning an error so dump a tail of the output
dump_output

View File

@ -8,7 +8,7 @@ export PING_PID_FILE=/tmp/build-sonar-ping.pid
source .travis/background-job-funcs.sh
# Run the build, redirect output into the file
mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent package sonar:sonar -Dsonar.host.url=https://sonarqube.com -Dsonar.login=${SONAR_TOKEN} -B -V >> $BUILD_OUTPUT 2>&1
./mvnw clean org.jacoco:jacoco-maven-plugin:prepare-agent package sonar:sonar -Dsonar.host.url=https://sonarqube.com -Dsonar.login=${SONAR_TOKEN} -B -V >> $BUILD_OUTPUT 2>&1
# The build finished without returning an error so dump a tail of the output
dump_output

View File

@ -0,0 +1,7 @@
#!/bin/bash
set -ev
echo "MAVEN_OPTS='-Xms1g -Xmx1g'" > $HOME/.mavenrc
mkdir -p .m2
cp .travis/travis-toolchains.xml $HOME/.m2/toolchains.xml
cp .travis/travis-settings.xml $HOME/.m2/settings.xml

View File

@ -1,15 +0,0 @@
#!/bin/bash
set -ev
# remember the current directory
SOURCE_HOME=$PWD
cd $HOME
wget -q http://www-us.apache.org/dist/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
tar zxf apache-maven-3.3.9-bin.tar.gz
chmod +x apache-maven-3.3.9/bin/mvn
echo "MAVEN_OPTS='-Xms1g -Xmx1g'" > .mavenrc
mkdir -p .m2
cp $SOURCE_HOME/.travis/travis-toolchains.xml .m2/toolchains.xml
cp $SOURCE_HOME/.travis/travis-settings.xml .m2/settings.xml

View File

@ -1,7 +1,7 @@
#!/bin/bash
set -ev
RELEASE_VERSION=$(mvn -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.5.0:exec)
RELEASE_VERSION=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.5.0:exec)
# Deploy to ossrh has already been done with the usual build. See build-push.sh

View File

@ -21,7 +21,7 @@ echo "Releasing PMD"
echo "-------------------------------------------"
# see also https://gist.github.com/pdunnavant/4743895
CURRENT_VERSION=$(mvn -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.5.0:exec)
CURRENT_VERSION=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.5.0:exec)
RELEASE_VERSION=${CURRENT_VERSION%-SNAPSHOT}
CURRENT_BUILD_NUMBER=$(echo ${RELEASE_VERSION} | sed -e 's/[0-9]*\.//g')
NEXT_BUILD_NUMBER=$(expr ${CURRENT_BUILD_NUMBER} + 1)
@ -68,7 +68,7 @@ git commit -a -m "Prepare pmd release ${RELEASE_VERSION}"
git push
)
mvn -B release:clean release:prepare \
./mvnw -B release:clean release:prepare \
-Dtag=pmd_releases/${RELEASE_VERSION} \
-DreleaseVersion=${RELEASE_VERSION} \
-DdevelopmentVersion=${DEVELOPMENT_VERSION}