[doc] Update docs, remove toolchain requirements, require java 9
This commit is contained in:
21
BUILDING.md
21
BUILDING.md
@ -1,11 +1,7 @@
|
|||||||
# How to build PMD
|
# How to build PMD
|
||||||
|
|
||||||
PMD uses [Maven](https://maven.apache.org/).
|
PMD uses [Maven](https://maven.apache.org/) and requires [Java 9](http://www.oracle.com/technetwork/java/javase/downloads/index.html)
|
||||||
|
for building.
|
||||||
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 the [maven wrapper](https://github.com/takari/maven-wrapper), so you can simply build PMD as following:
|
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 !
|
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
|
cd docs
|
||||||
./mvnw install site site:stage -Psite
|
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).
|
||||||
|
@ -6,32 +6,34 @@ author: Tom Copeland, Xavier Le Vourch <xlv@users.sourceforge.net>
|
|||||||
|
|
||||||
# Compiling PMD
|
# Compiling PMD
|
||||||
|
|
||||||
* JDK 1.7 or higher
|
* JDK 9 or higher
|
||||||
* [Apache Maven](http://maven.apache.org) 3 or later.
|
* [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:
|
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
|
[tom@hal building]$ ls -l
|
||||||
total 5716
|
total 5716
|
||||||
-rw-rw-r-- 1 tom tom 5837216 Jul 17 13:09 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-5.5.0.zip
|
[tom@hal building]$ unzip -q pmd-src-{{site.pmd.version}}.zip
|
||||||
[tom@hal building]$
|
[tom@hal building]$
|
||||||
```
|
```
|
||||||
|
|
||||||
Now cd down into the `pmd` directory:
|
Now cd down into the `pmd` directory:
|
||||||
|
|
||||||
```
|
```
|
||||||
[tom@hal building]$ cd pmd-src-5.5.0
|
[tom@hal building]$ cd pmd-src-{{site.pmd.version}}
|
||||||
[tom@hal pmd-src-5.5.0]$ ls -l | grep pom.xml
|
[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
|
-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!
|
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] Scanning for projects...
|
||||||
[INFO] ------------------------------------------------------------------------
|
[INFO] ------------------------------------------------------------------------
|
||||||
[INFO] Reactor Build Order:
|
[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] Finished at: 2015-11-14T17:46:06+01:00
|
||||||
[INFO] Final Memory: 63M/765M
|
[INFO] Final Memory: 63M/765M
|
||||||
[INFO] ------------------------------------------------------------------------
|
[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`. 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!
|
||||||
|
@ -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>
|
|
Reference in New Issue
Block a user