Skip to content

Commit 8d73cf7

Browse files
Specifying usage instructions for 0.5.0-M1
1 parent d6aa518 commit 8d73cf7

File tree

1 file changed

+40
-7
lines changed

1 file changed

+40
-7
lines changed

README.md

Lines changed: 40 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,17 @@ It runs PMD's God Class Rule and Coupling Between Objects rule and scans your Gi
66
The graphs generated in the report will look similar to this one:
77
![image info](./RefactorFirst_Sample_Report.png)
88

9+
## Please Note: Java 11 is now required to run RefactorFirst
10+
The change to require Java 11 is needed to address vulnerability CVE-2023-4759 in JGit
11+
Java 21 features are not yet integrated since PMD APIs have changed.
12+
913
## There are several ways to run the analysis on your codebase:
1014

1115
### From The Command Line
1216
Run the following command from the root of your project (the source code does not need to be built):
1317

1418
```bash
15-
mvn org.hjug.refactorfirst.plugin:refactor-first-maven-plugin:0.4.0:report
19+
mvn org.hjug.refactorfirst.plugin:refactor-first-maven-plugin:0.5.0-M1:report
1620
```
1721

1822
### As Part of a Build
@@ -24,7 +28,7 @@ Add the following to your project in the build section. **showDetails** will sh
2428
<plugin>
2529
<groupId>org.hjug.refactorfirst.plugin</groupId>
2630
<artifactId>refactor-first-maven-plugin</artifactId>
27-
<version>0.4.0</version>
31+
<version>0.5.0-M1</version>
2832
<!-- optional -->
2933
<configuration>
3034
<showDetails>true</showDetails>
@@ -35,23 +39,51 @@ Add the following to your project in the build section. **showDetails** will sh
3539
</build>
3640
```
3741

38-
### As a Report
39-
Add the following to your project in the reports section.
40-
Not supported as of Version 0.2.0 due to CVE-2020-13936
42+
### As a Maven Report
43+
Add the following to your project in the reports section.
44+
A RefactorFirst report will show up in the site report when you run ```mvn site```
4145
```xml
4246
<reporting>
4347
<plugins>
4448
...
4549
<plugin>
4650
<groupId>org.hjug.refactorfirst.plugin</groupId>
4751
<artifactId>refactor-first-maven-plugin</artifactId>
48-
<version>0.1.1</version>
52+
<version>0.5.0-M1</version>
4953
</plugin>
5054
...
5155
</plugins>
5256
</reporting>
5357
```
5458

59+
If you see an error similar to
60+
```
61+
Execution default-site of goal org.apache.maven.plugins:maven-site-plugin:3.3:site failed: A required class was missing while executing org.apache.maven.plugins:maven-site-plugin:3.3:site: org/apache/maven/doxia/siterenderer/DocumentContent
62+
```
63+
you will need to add the following to your pom.xml:
64+
```xml
65+
<build>
66+
<plugins>
67+
<plugin>
68+
<groupId>org.apache.maven.plugins</groupId>
69+
<artifactId>maven-site-plugin</artifactId>
70+
<version>3.12.1</version>
71+
</plugin>
72+
<plugin>
73+
<groupId>org.apache.maven.plugins</groupId>
74+
<artifactId>maven-project-info-reports-plugin</artifactId>
75+
<version>3.4.5</version>
76+
</plugin>
77+
</plugins>
78+
</build>
79+
```
80+
81+
### As an HTML Report
82+
```bash
83+
mvn org.hjug.refactorfirst.plugin:refactor-first-maven-plugin:0.5.0-M1:htmlReport
84+
```
85+
View the report at ```target/site/refactor-first-report.html```
86+
5587
## But I'm using Gradle / my project layout isn't typical!
5688
I would like to create a Gradle plugin and (possibly) support non-conventional projects in the future, but in the meantime you can create a dummy POM file in the same directory as your .git directory:
5789

@@ -68,10 +100,11 @@ I would like to create a Gradle plugin and (possibly) support non-conventional p
68100
and then (assuming Maven is installed) run
69101

70102
```bash
71-
mvn org.hjug.refactorfirst.plugin:refactor-first-maven-plugin:0.4.0:report
103+
mvn org.hjug.refactorfirst.plugin:refactor-first-maven-plugin:0.5.0-M1:htmlReport
72104
```
73105

74106
## Viewing the Report
107+
View the report at ```target/site/refactor-first-report.html```
75108
Once the plugin finishes executing (it may take a while for a large / old codebase), open the file **target/site/refactor-first-report.html** in the root of the project. It will contain a graph similar to the one above, and a table that lists God classes in the recommended order that they should be refactored. The classes in the top left of the graph are the easiest to refactor while also having the biggest positive impact to team productivity.
76109
If highly coupled classes are detected, a graph and table listing Highly Coupled Classes in will be generated.
77110

0 commit comments

Comments
 (0)