Skip to content

Commit

Permalink
AjcReportMojo: Clean up more parameters, getters, setters
Browse files Browse the repository at this point in the history
  • Loading branch information
kriegaex committed Oct 19, 2023
1 parent 2e21be0 commit 2b0c56a
Showing 1 changed file with 10 additions and 39 deletions.
49 changes: 10 additions & 39 deletions src/main/java/org/codehaus/mojo/aspectj/AjcReportMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,10 @@

import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.handler.ArtifactHandler;
import org.apache.maven.doxia.siterenderer.Renderer;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugins.annotations.Component;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.plugins.annotations.ResolutionScope;
import org.apache.maven.project.MavenProject;
import org.apache.maven.reporting.AbstractMavenReport;
import org.apache.maven.reporting.MavenReportException;
import org.aspectj.tools.ajdoc.Main;
Expand Down Expand Up @@ -71,13 +68,6 @@ public class AjcReportMojo
@Parameter( defaultValue = "src/test/aspect" )
private String testAspectDirectory = "src/test/aspect";

/**
* The maven project.
*
*/
@Parameter( readonly = true, required = true, defaultValue = "${project}" )
private MavenProject project;

/**
* The basedir of the project.
*
Expand All @@ -86,11 +76,18 @@ public class AjcReportMojo
private File basedir;

/**
* The output directory for the report.
*
* The output directory for the report. Note that this parameter is only evaluated if the goal is run directly from
* the command line. If the goal is run indirectly as part of a site generation, the output directory configured in
* the Maven Site Plugin is used instead.
*/
// We do need @Parameter due to the overridden 'defaultValue'. This is why, while re-using the super class field, we
// define a setter to place an annotation on. The javadoc is copied from the super class field, though.
//
// Note: In contrast to the super class property, this one is not read-only!
@Parameter( required = true, defaultValue = "${project.reporting.outputDirectory}/aspectj-report" )
private File outputDirectory;
public void setOutputDirectory(File outputDirectory) {
this.outputDirectory = outputDirectory;
}

/**
* The build directory (normally "${basedir}/target").
Expand Down Expand Up @@ -200,16 +197,6 @@ public class AjcReportMojo
@Parameter( readonly = true, required = true, defaultValue = "${plugin.artifacts}" )
private List<Artifact> pluginArtifacts;

@Override
public void execute() throws MojoExecutionException {
//super.execute();
try {
executeReport(Locale.getDefault());
}
catch (MavenReportException e) {
throw new MojoExecutionException(e);
}
}

/**
* Executes this ajdoc-report generation.
Expand Down Expand Up @@ -297,14 +284,6 @@ protected List<String> getSourceDirectories()
return sourceDirectories;
}

/**
* get report output directory.
*/
protected String getOutputDirectory()
{
return outputDirectory.getAbsolutePath();
}

/**
* @return list of classpath directories
*/
Expand Down Expand Up @@ -356,14 +335,6 @@ public boolean canGenerateReport()
return "java".equals( artifactHandler.getLanguage() );
}

/**
* Get the maven project.
*/
protected MavenProject getProject()
{
return project;
}

public void setOverview( String overview )
{
ajcOptions.add( "-overview" );
Expand Down

0 comments on commit 2b0c56a

Please sign in to comment.