Skip to content

Commit b08bce9

Browse files
committed
Breaking change: use Doxia 2 default directory 'target/reports'
After my PR apache/maven-reporting-impl#26 for https://issues.apache.org/jira/browse/MSHARED-1327 was merged, the base directory for reports in AbstractMavenReport when calling mojos stand-alone, i.e. outside a site generation context, no longer defaults to 'target/site' but now to 'target/reports'. This is good, because reports for a Maven site can look different from reports for a single module. As AjcReportMojo extends AbstractMavenReport, we can respect the new default easily and even save lines of code and documentation, because we can just inherit the 'outputDirectory' property instead of overriding and documenting it.
1 parent 800a615 commit b08bce9

File tree

3 files changed

+6
-23
lines changed

3 files changed

+6
-23
lines changed

pom.xml

+4-3
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
<inceptionYear>2018</inceptionYear>
2929

3030
<properties>
31+
<!-- When upgrading to 1.9.21+, the plugin no longer runs on JDK 11, because AJC does not because ECJ does not -->
3132
<aspectjVersion>1.9.20.1</aspectjVersion>
3233

3334
<!-- Minimum Maven version required to build this plugin -->
@@ -42,7 +43,7 @@
4243

4344
<junitVersion>4.13.2</junitVersion>
4445
<doxiaVersion>2.0.0-M8</doxiaVersion>
45-
<doxiaSitetoolsVersion>2.0.0-M13</doxiaSitetoolsVersion>
46+
<doxiaSitetoolsVersion>2.0.0-M16</doxiaSitetoolsVersion>
4647
<!-- Override mojo-parent:77 - requires Java 11+ -->
4748
<checkstyle.version>10.12.2</checkstyle.version>
4849
<mojo.java.target>8</mojo.java.target> <!-- aspectJ > 1.8.13 is JDK 8 minimum -->
@@ -207,12 +208,12 @@
207208
<dependency>
208209
<groupId>org.apache.maven.reporting</groupId>
209210
<artifactId>maven-reporting-api</artifactId>
210-
<version>4.0.0-M8</version>
211+
<version>4.0.0-M9</version>
211212
</dependency>
212213
<dependency>
213214
<groupId>org.apache.maven.reporting</groupId>
214215
<artifactId>maven-reporting-impl</artifactId>
215-
<version>4.0.0-M11</version>
216+
<version>4.0.0-M13</version>
216217
</dependency>
217218
<dependency>
218219
<groupId>org.apache.maven</groupId>

src/it/CreateReport/verify.groovy

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
indexFile = new File(basedir, "target/aspectj-report/index.html")
1+
indexFile = new File(basedir, "target/reports/aspectj-report/index.html")
22
assert indexFile.exists()
3-
clazzFile = new File(basedir, "target/aspectj-report/Clazz.html")
3+
clazzFile = new File(basedir, "target/reports/aspectj-report/Clazz.html")
44
assert clazzFile.getText().contains("Advised&nbsp;by:")

src/main/java/org/codehaus/mojo/aspectj/AjcReportMojo.java

-18
Original file line numberDiff line numberDiff line change
@@ -87,24 +87,6 @@ public class AjcReportMojo
8787
@Parameter( readonly = true, required = true, defaultValue = "${basedir}" )
8888
private File basedir;
8989

90-
/**
91-
* The output base directory for the report. Note that this parameter is only evaluated if the goal is run directly
92-
* from the command line. If the goal is run indirectly as part of a site generation, the output base directory
93-
* configured in the Maven Site Plugin is used instead, e.g.
94-
* {@code <outputDirectory>$&#123;project.build.directory&#125;/custom-site</outputDirectory>}.
95-
* To either base directory, a file separator "/" + the value of {@code reportDirectory} is added to determine the
96-
* actual target directory.
97-
*/
98-
// We do need @Parameter due to the overridden 'defaultValue'. This is why, while re-using the super class field, we
99-
// define a setter to place an annotation on. The javadoc was copied from the super class field, then improved and
100-
// amended by an example.
101-
//
102-
// Note: In contrast to the super class property, this one is not read-only!
103-
@Parameter( required = true, defaultValue = "${project.build.directory}" )
104-
public void setOutputDirectory(File outputDirectory) {
105-
this.outputDirectory = outputDirectory;
106-
}
107-
10890
/**
10991
* The build directory (normally "${basedir}/target").
11092
*

0 commit comments

Comments
 (0)