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/do-release.sh b/do-release.sh index cf7d746579..109e62c4df 100755 --- a/do-release.sh +++ b/do-release.sh @@ -69,15 +69,6 @@ echo "Releasing PMD" echo "-------------------------------------------" -MVN_VERSION=$(mvn --version | grep "Java version: 1.7") -if [ $? -ne 0 ]; then - echo "Wrong java version!" - echo "Expected 1.7, 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 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 b5fe4e20d9..35f3cb4f2c 100644 --- a/pom.xml +++ b/pom.xml @@ -388,6 +388,25 @@ alphabetical + + org.apache.maven.plugins + maven-toolchains-plugin + 1.1 + + + + toolchain + + + + + + + ${java.version} + + + + org.codehaus.mojo build-helper-maven-plugin @@ -563,6 +582,10 @@ ${checkstyle.suppressionsFile} + + org.apache.maven.plugins + maven-toolchains-plugin + @@ -941,6 +964,31 @@ pmd-scala + + + travis + + + + + + env.TRAVIS + true + + + + + + maven-toolchains-plugin + + + none + + + + + +