From 6be8547f3e9e1625096bd6fb0031bb3f744c8dbe Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Sun, 10 Apr 2016 16:55:25 +0200 Subject: [PATCH] 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 b4be81bcceb..7f388a78665 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 00000000000..b26f86ce587 --- /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 0dda0234108..4bc334c283a 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 + + + + + +