Skip to content

Commit

Permalink
Fix commands for custom rule manually
Browse files Browse the repository at this point in the history
  • Loading branch information
adangel committed Sep 12, 2018
1 parent 5d76c81 commit 74e40b9
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions custom-rule-manually/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,29 @@

1. Create a directory `code` in your home directory:

$ mkdir ~code
$ cd ~code
$ mkdir ~/code
$ cd ~/code

For the following steps, it is assumed, you are in that directory.

2. Get the binary distribution of PMD from <https://github.com/pmd/pmd/releases>, e.g. pmd-bin-6.0.1.zip:

$ wget https://github.com/pmd/pmd/releases/download/pmd_releases%2F6.0.1/pmd-bin-6.0.1.zip`
$ wget https://github.com/pmd/pmd/releases/download/pmd_releases%2F6.0.1/pmd-bin-6.0.1.zip

3. Extract the zip file, e.g. `unzip pmd-bin-6.0.1.zip`

$ unzip pmd-bin-6.0.1.zip

4. Now, the pmd binaries are installed under `~code/pmd-bin-6.0.1`.
4. Now, the pmd binaries are installed under `~/code/pmd-bin-6.0.1`.

This also includes the libraries in `~code/pmd-bin-6.0.1/lib`.
This also includes the libraries in `~/code/pmd-bin-6.0.1/lib`.

## Get the code from this example and build it

1. Clone the sample repo

$ cd ~code
$ git clone https://... pmd-examples
$ cd ~/code
$ git clone https://github.com/pmd/pmd-examples.git pmd-examples
$ cd pmd-examples/custom-rule-manually

2. Prepare the output directory for the compilation step
Expand All @@ -35,7 +35,7 @@

3. Compile the sources, that are located in `src`, using the PMD libraries

$ javac -d build -cp '../pmd-bin-6.0.1/lib/*' src/*.java
$ javac -d build -cp '../../pmd-bin-6.0.1/lib/*' src/*.java

4. Create a jar file

Expand All @@ -46,7 +46,7 @@

1. Run PMD with the just created jar file on the classpath, e.g. on the folder `testsrc`

$ CLASSPATH=custom-rule-example.jar ../pmd-bin-6.0.1/bin/run.sh pmd -f text -d testsrc -R myrule.xml
$ CLASSPATH=custom-rule-example.jar ../../pmd-bin-6.0.1/bin/run.sh pmd -f text -d testsrc -R myrule.xml
Feb. 08, 2018 3:14:02 NACHM. net.sourceforge.pmd.cache.NoopAnalysisCache <init>
WARNUNG: This analysis could be faster, please consider using Incremental Analysis: https://pmd.github.io/pmd-6.0.1/pmd_userdocs_getting_started.html#incremental-analysis
/home/andreas/code/pmd-examples/custom-rule-manually/testsrc/Test.java:2: Avoid the identifier foo.

0 comments on commit 74e40b9

Please sign in to comment.