[doc] Update docs, remove toolchain requirements, require java 9

This commit is contained in:
Andreas Dangel 2017-09-24 10:34:09 +02:00
parent 577ef1ff71
commit 166f958ce2
3 changed files with 27 additions and 51 deletions

View File

@ -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).
Building the maven site is done with the following commands:
## How to build the documentation?
./mvnw clean install -DskipTests=true
./mvnw install site site:stage -Psite
cd docs
bundle install # once
bundle exec jekyll build
You'll find the built site in the directory `target/staging/`.
You'll find the built site in the directory `_site/`.
For more info, see [README in docs directory](docs/README.md).

View File

@ -6,32 +6,34 @@ author: Tom Copeland, Xavier Le Vourch <xlv@users.sourceforge.net>
# 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)." %}
Youll need to either check out the source code or download the latest source release. Assuming youve 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}}]$
```
Thats the project configuration for maven… lets 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 @@ Thats the project configuration for maven… lets 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 <tt>pmd-dist/target</tt>.
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`. Theyre also in the jar file thats 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`.
Theyre also in the jar file thats included with both the source and binary distributions.
A paucity of detail, Im sure youd 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, Im sure youd 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!

View File

@ -1,28 +0,0 @@
<?xml version="1.0" encoding="UTF8"?>
<toolchains>
<!-- place this file in ${user.home}/.m2/toolchains.xml -->
<!-- adjust the paths to jdkhome -->
<toolchain>
<type>jdk</type>
<provides>
<version>1.7</version>
</provides>
<configuration>
<jdkHome>/path/to/jdk/1.7</jdkHome> <!-- Linux -->
<jdkHome>/Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home</jdkHome> <!-- MacOSX -->
<jdkHome>C:\\java\\edition\\jdk1.7.0_80</jdkHome> <!-- Windows -->
</configuration>
</toolchain>
<toolchain>
<type>jdk</type>
<provides>
<version>1.8</version>
</provides>
<configuration>
<jdkHome>/path/to/jdk/1.8</jdkHome> <!-- Linux -->
<jdkHome>/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home</jdkHome> <!-- MacOSX -->
<jdkHome>C:\\java\\edition\\jdk1.8.0_131</jdkHome> <!-- Windows -->
</configuration>
</toolchain>
</toolchains>