diff --git a/BUILDING.md b/BUILDING.md index 04bb7f1df70..78865d329fa 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -1,11 +1,7 @@ # How to build PMD -PMD uses [Maven](https://maven.apache.org/). - -You'll need to have a `~/.m2/toolchains.xml` file setup -with jdk 1.7 and jdk 1.8 (for some features in pmd). -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). +PMD uses [Maven](https://maven.apache.org/) and requires [Java 9](http://www.oracle.com/technetwork/java/javase/downloads/index.html) +for building. PMD uses the [maven wrapper](https://github.com/takari/maven-wrapper), so you can simply build PMD as following: @@ -19,11 +15,14 @@ This will create the zip files in the directory `pmd-dist/target`: That's all ! -## How to build the documentation (maven site)? +**Note:** While Java 9 is required for building, running PMD only requires Java 7 (or Java 8 for Apex). + +## How to build the documentation? -Building the maven site is done with the following commands: + cd docs + bundle install # once + bundle exec jekyll build - ./mvnw clean install -DskipTests=true - ./mvnw install site site:stage -Psite +You'll find the built site in the directory `_site/`. -You'll find the built site in the directory `target/staging/`. +For more info, see [README in docs directory](docs/README.md). diff --git a/docs/pages/pmd/devdocs/building.md b/docs/pages/pmd/devdocs/building.md index 35b4e5e676c..a7119c7bb16 100644 --- a/docs/pages/pmd/devdocs/building.md +++ b/docs/pages/pmd/devdocs/building.md @@ -6,32 +6,34 @@ author: Tom Copeland, Xavier Le Vourch # Compiling PMD -* JDK 1.7 or higher +* JDK 9 or higher * [Apache Maven](http://maven.apache.org) 3 or later. +{% include note.html content="While Java 9 is required for building, running PMD only requires Java 7 (or Java 8 for Apex)." %} + You’ll need to either check out the source code or download the latest source release. Assuming you’ve got the latest source release, unzip it to a directory: ``` [tom@hal building]$ ls -l total 5716 --rw-rw-r-- 1 tom tom 5837216 Jul 17 13:09 pmd-src-5.5.0.zip -[tom@hal building]$ unzip -q pmd-src-5.5.0.zip +-rw-rw-r-- 1 tom tom 5837216 Jul 17 13:09 pmd-src-{{site.pmd.version}}.zip +[tom@hal building]$ unzip -q pmd-src-{{site.pmd.version}}.zip [tom@hal building]$ ``` Now cd down into the `pmd` directory: ``` -[tom@hal building]$ cd pmd-src-5.5.0 -[tom@hal pmd-src-5.5.0]$ ls -l | grep pom.xml +[tom@hal building]$ cd pmd-src-{{site.pmd.version}} +[tom@hal pmd-src-{{site.pmd.version}}]$ ls -l | grep pom.xml -rw-rw-r-- 1 tom tom 36482 14\. Nov 17:36 pom.xml -[tom@hal pmd-src-5.5.0]$ +[tom@hal pmd-src-{{site.pmd.version}}]$ ``` That’s the project configuration for maven… let’s compile! ``` -[tom@hal pmd-src-5.5.0]$ mvn clean package +[tom@hal pmd-src-{{site.pmd.version}}]$ ./mvnw clean verify [INFO] Scanning for projects... [INFO] ------------------------------------------------------------------------ [INFO] Reactor Build Order: @@ -71,13 +73,16 @@ That’s the project configuration for maven… let’s compile! [INFO] Finished at: 2015-11-14T17:46:06+01:00 [INFO] Final Memory: 63M/765M [INFO] ------------------------------------------------------------------------ -[tom@hal pmd-src-5.5.0]$ +[tom@hal pmd-src-{{site.pmd.version}}]$ ``` -Now the source and binary distribution zip files can be found in the folder pmd-dist/target. +Now the source and binary distribution zip files can be found in the folder `pmd-dist/target`. -Notes: +**Notes:** -* The rules that have already been written are specified in the src/main/resources/rulesets/ directories of the specific languages, e.g. `pmd-java/src/main/resources/rulesets`. They’re also in the jar file that’s included with both the source and binary distributions. +* The rules that have already been written are specified in the `src/main/resources/rulesets/` directories of +the specific languages, e.g. `pmd-java/src/main/resources/rulesets`. +They’re also in the jar file that’s included with both the source and binary distributions. -A paucity of detail, I’m sure you’d agree. If you think this document can be improved, please post [here](http://sourceforge.net/p/pmd/discussion/188192) and let me know how. Thanks! +A paucity of detail, I’m sure you’d agree. If you think this document can be improved, +please post [here](http://sourceforge.net/p/pmd/discussion/188192) and let me know how. Thanks! diff --git a/example-toolchains.xml b/example-toolchains.xml deleted file mode 100644 index ff0b1d5c954..00000000000 --- a/example-toolchains.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - jdk - - 1.7 - - - /path/to/jdk/1.7 - /Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home - C:\\java\\edition\\jdk1.7.0_80 - - - - jdk - - 1.8 - - - /path/to/jdk/1.8 - /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home - C:\\java\\edition\\jdk1.8.0_131 - - - \ No newline at end of file