Skip to content

Commit bcbc9d4

Browse files
Merge pull request #71 from jimbethancourt/#62-mvn-site
#62 mvn site and #70 GH buttons on mvn site generated page
2 parents b7826b5 + 2cab42e commit bcbc9d4

File tree

6 files changed

+712
-22
lines changed

6 files changed

+712
-22
lines changed

README.md

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The graphs generated in the report will look similar to this one:
1212
Run the following command from the root of your project (the source code does not need to be built):
1313

1414
```bash
15-
mvn org.hjug.refactorfirst.plugin:refactor-first-maven-plugin:0.4.0:report
15+
mvn org.hjug.refactorfirst.plugin:refactor-first-maven-plugin:0.5.0:report
1616
```
1717

1818
### As Part of a Build
@@ -24,7 +24,7 @@ Add the following to your project in the build section. **showDetails** will sh
2424
<plugin>
2525
<groupId>org.hjug.refactorfirst.plugin</groupId>
2626
<artifactId>refactor-first-maven-plugin</artifactId>
27-
<version>0.4.0</version>
27+
<version>0.5.0</version>
2828
<!-- optional -->
2929
<configuration>
3030
<showDetails>true</showDetails>
@@ -35,23 +35,49 @@ Add the following to your project in the build section. **showDetails** will sh
3535
</build>
3636
```
3737

38-
### As a Report
38+
### As a Maven Report
3939
Add the following to your project in the reports section.
40-
Not supported as of Version 0.2.0 due to CVE-2020-13936
4140
```xml
4241
<reporting>
4342
<plugins>
4443
...
4544
<plugin>
4645
<groupId>org.hjug.refactorfirst.plugin</groupId>
4746
<artifactId>refactor-first-maven-plugin</artifactId>
48-
<version>0.1.1</version>
47+
<version>0.5.0</version>
4948
</plugin>
5049
...
5150
</plugins>
5251
</reporting>
5352
```
5453

54+
If you see an error similar to
55+
```
56+
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
57+
```
58+
you will need to add the following to your pom.xml:
59+
```xml
60+
<build>
61+
<plugins>
62+
<plugin>
63+
<groupId>org.apache.maven.plugins</groupId>
64+
<artifactId>maven-site-plugin</artifactId>
65+
<version>3.12.1</version>
66+
</plugin>
67+
<plugin>
68+
<groupId>org.apache.maven.plugins</groupId>
69+
<artifactId>maven-project-info-reports-plugin</artifactId>
70+
<version>3.4.5</version>
71+
</plugin>
72+
</plugins>
73+
</build>
74+
```
75+
76+
### As an HTML Report
77+
```bash
78+
mvn org.hjug.refactorfirst.plugin:refactor-first-maven-plugin:0.5.0:htmlReport
79+
```
80+
5581
## But I'm using Gradle / my project layout isn't typical!
5682
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:
5783

effort-ranker/src/main/java/org/hjug/metrics/GodClassRanker.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ void rankAtfd(List<GodClass> godClasses) {
5353
}
5454

5555
void rankTcc(List<GodClass> godClasses) {
56-
log.info("Calculating Total Cyclomatic Complexity (TCC) Rank");
56+
log.info("Calculating Tight Class Cohesion (TCC) Rank");
5757
godClasses.sort(Comparator.comparing(GodClass::getTcc));
5858

5959
Function<GodClass, Float> getTcc = GodClass::getTcc;

pom.xml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -314,21 +314,21 @@
314314
</executions>
315315
-->
316316
</plugin>
317-
<plugin>
318-
<groupId>org.owasp</groupId>
319-
<artifactId>dependency-check-maven</artifactId>
320-
<version>6.1.0</version>
321-
<configuration>
322-
<failBuildOnCVSS>8.0</failBuildOnCVSS>
323-
</configuration>
324-
<executions>
325-
<execution>
326-
<goals>
327-
<goal>check</goal>
328-
</goals>
329-
</execution>
330-
</executions>
331-
</plugin>
317+
<!-- <plugin>-->
318+
<!-- <groupId>org.owasp</groupId>-->
319+
<!-- <artifactId>dependency-check-maven</artifactId>-->
320+
<!-- <version>6.1.0</version>-->
321+
<!-- <configuration>-->
322+
<!-- <failBuildOnCVSS>8.0</failBuildOnCVSS>-->
323+
<!-- </configuration>-->
324+
<!-- <executions>-->
325+
<!-- <execution>-->
326+
<!-- <goals>-->
327+
<!-- <goal>check</goal>-->
328+
<!-- </goals>-->
329+
<!-- </execution>-->
330+
<!-- </executions>-->
331+
<!-- </plugin>-->
332332
<!--TODO: Add the SNYK plugin-->
333333
<!-- https://github.com/snyk/snyk-maven-plugin -->
334334

refactor-first-maven-plugin/pom.xml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,65 @@
1818
<artifactId>graph-data-generator</artifactId>
1919
</dependency>
2020

21+
<!-- Doxia -->
22+
<!-- Needed since maven-reporting-impl brings in Struts 1.3.8 jars that have CVSS > 8 -->
23+
<dependency>
24+
<groupId>org.apache.maven.doxia</groupId>
25+
<artifactId>doxia-sink-api</artifactId>
26+
<version>2.0.0-M6</version>
27+
</dependency>
28+
<dependency>
29+
<groupId>org.apache.maven.doxia</groupId>
30+
<artifactId>doxia-decoration-model</artifactId>
31+
<version>2.0.0-M6</version>
32+
</dependency>
33+
<dependency>
34+
<groupId>org.apache.maven.doxia</groupId>
35+
<artifactId>doxia-core</artifactId>
36+
<version>2.0.0-M7</version>
37+
</dependency>
38+
<dependency>
39+
<groupId>org.apache.maven.doxia</groupId>
40+
<artifactId>doxia-site-renderer</artifactId>
41+
<version>2.0.0-M11</version>
42+
</dependency>
43+
2144
<!-- Maven Reporting -->
2245
<dependency>
2346
<groupId>org.apache.maven</groupId>
2447
<artifactId>maven-core</artifactId>
2548
<version>${maven.core.version}</version>
2649
</dependency>
2750

51+
<!-- Maven Reporting -->
52+
<dependency>
53+
<groupId>org.apache.maven.reporting</groupId>
54+
<artifactId>maven-reporting-impl</artifactId>
55+
<version>3.2.0</version>
56+
</dependency>
57+
<dependency>
58+
<groupId>org.apache.maven.reporting</groupId>
59+
<artifactId>maven-reporting-api</artifactId>
60+
<version>3.1.1</version>
61+
</dependency>
62+
63+
<!-- plugin API and plugin-tools -->
64+
<dependency>
65+
<groupId>org.apache.maven</groupId>
66+
<artifactId>maven-plugin-api</artifactId>
67+
<version>3.5.2</version>
68+
</dependency>
2869
<dependency>
2970
<groupId>org.apache.maven.plugin-tools</groupId>
3071
<artifactId>maven-plugin-annotations</artifactId>
3172
<version>3.6.1</version>
3273
<scope>provided</scope>
3374
</dependency>
75+
<dependency>
76+
<groupId>org.apache.maven.shared</groupId>
77+
<artifactId>maven-shared-utils</artifactId>
78+
<version>3.3.3</version>
79+
</dependency>
3480

3581
<dependency>
3682
<groupId>com.fasterxml.jackson.core</groupId>

refactor-first-maven-plugin/src/main/java/org/hjug/mavenreport/RefactorFirstMavenReport.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
@Slf4j
2828
@Mojo(
29-
name = "report",
29+
name = "htmlReport",
3030
defaultPhase = LifecyclePhase.SITE,
3131
requiresDependencyResolution = ResolutionScope.RUNTIME,
3232
requiresProject = false,

0 commit comments

Comments
 (0)