Skip to content

Commit

Permalink
[doc] Update docs, remove toolchain requirements, require java 9
Browse files Browse the repository at this point in the history
  • Loading branch information
adangel committed Sep 24, 2017
1 parent 577ef1f commit 166f958
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 51 deletions.
21 changes: 10 additions & 11 deletions 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:

Expand All @@ -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).
29 changes: 17 additions & 12 deletions docs/pages/pmd/devdocs/building.md
Expand Up @@ -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)." %}

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:
Expand Down Expand Up @@ -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 <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!
28 changes: 0 additions & 28 deletions example-toolchains.xml

This file was deleted.

0 comments on commit 166f958

Please sign in to comment.