From 6be8547f3e9e1625096bd6fb0031bb3f744c8dbe Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Sun, 10 Apr 2016 16:55:25 +0200 Subject: [PATCH 1/2] Add maven toolchains --- README.md | 6 +++++- example-toolchains.xml | 32 ++++++++++++++++++++++++++++ pom.xml | 48 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 example-toolchains.xml diff --git a/README.md b/README.md index b4be81bcce..7f388a7866 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,11 @@ Our latest source of PMD can be found on [GitHub]. Fork us! ### How to build PMD? -Simply use maven in the top-level directory: +You'll need to have a `~/.m2/toolchains.xml` file setup with jdk 1.6 (for pmd 5.3.x), jdk 1.7 (for pmd 5.4.x and pmd 5.5.x) +and jdk 1.8 (for some features in pmd 5.5.x). See [maven toolchains](https://maven.apache.org/guides/mini/guide-using-toolchains.html). +A example file can be found here: [example-toolchains.xml](https://github.com/pmd/pmd/blob/master/example-toolchains.xml). + +Use maven in the top-level directory: mvn clean package diff --git a/example-toolchains.xml b/example-toolchains.xml new file mode 100644 index 0000000000..b26f86ce58 --- /dev/null +++ b/example-toolchains.xml @@ -0,0 +1,32 @@ + + + + + + jdk + + 1.6 + + + /path/to/jdk/1.6 + + + + jdk + + 1.7 + + + /path/to/jdk/1.7 + + + + jdk + + 1.8 + + + /path/to/jdk/1.8 + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index 0dda023410..4bc334c283 100644 --- a/pom.xml +++ b/pom.xml @@ -387,6 +387,25 @@ alphabetical + + org.apache.maven.plugins + maven-toolchains-plugin + 1.1 + + + + toolchain + + + + + + + ${java.version} + + + + org.codehaus.mojo build-helper-maven-plugin @@ -557,6 +576,10 @@ ${checkstyle.suppressionsFile} + + org.apache.maven.plugins + maven-toolchains-plugin + @@ -897,6 +920,31 @@ pmd-scala + + + travis + + + + + + env.TRAVIS + true + + + + + + maven-toolchains-plugin + + + none + + + + + + From 6fc617bd1153b1dab9949bbde874af02d9951291 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Sun, 10 Apr 2016 17:03:30 +0200 Subject: [PATCH 2/2] Java version is now handled by toolchain --- do-release.sh | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/do-release.sh b/do-release.sh index aba9a52db5..0e93be295d 100755 --- a/do-release.sh +++ b/do-release.sh @@ -48,7 +48,7 @@ fi # verify the current directory if [ ! -f pom.xml -o ! -d ../pmd.github.io ]; then - echo "You seem to be in the work working directory or you don't have pmd.github.io checked out..." + echo "You seem to be in the wrong working directory or you don't have pmd.github.io checked out..." echo echo "Expected:" echo "* You are currently in the pmd repository" @@ -69,15 +69,6 @@ echo "Releasing PMD" echo "-------------------------------------------" -MVN_VERSION=$(mvn --version | grep "Java version: 1.6") -if [ $? -ne 0 ]; then - echo "Wrong java version!" - echo "Expected 1.6, but was:" - mvn --version - exit 1 -fi - - if [ "" = "$RELEASE_VERSION" ]; then echo -n "What is the release version of PMD? (e.g. 5.4.0) " read RELEASE_VERSION @@ -87,7 +78,7 @@ if [ "" = "$DEVELOPMENT_VERSION" ]; then read DEVELOPMENT_VERSION fi if [ "" = "$CURRENT_BRANCH" ]; then - echo -n "What is the branch you want to release from? (e.g. master or pmd/5.3.x) " + echo -n "What is the branch you want to release from? (e.g. master or pmd/5.4.x or pmd/5.3.x) " read CURRENT_BRANCH fi