Skip to content

[MJAVADOC-801] Upgrade to Clirr Maven Plugin 2.8 in fix goals #296

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@
import org.apache.maven.settings.Settings;
import org.apache.maven.shared.invoker.MavenInvocationException;
import org.codehaus.plexus.components.interactivity.InputHandler;
import org.codehaus.plexus.languages.java.version.JavaVersion;
import org.codehaus.plexus.util.FileUtils;
import org.codehaus.plexus.util.ReaderFactory;
import org.codehaus.plexus.util.StringUtils;
Expand Down Expand Up @@ -193,9 +192,9 @@ public abstract class AbstractFixJavadocMojo extends AbstractMojo {
private static final String CLIRR_MAVEN_PLUGIN_ARTIFACTID = "clirr-maven-plugin";

/**
* The latest Clirr Maven plugin version <code>2.2.2</code> *
* The latest Clirr Maven plugin version <code>2.8</code> *
*/
private static final String CLIRR_MAVEN_PLUGIN_VERSION = "2.2.2";
private static final String CLIRR_MAVEN_PLUGIN_VERSION = "2.8";

/**
* The Clirr Maven plugin goal <code>check</code> *
Expand Down Expand Up @@ -223,7 +222,7 @@ public abstract class AbstractFixJavadocMojo extends AbstractMojo {

/**
* Version to compare the current code against using the
* <a href="http://mojo.codehaus.org/clirr-maven-plugin/">Clirr Maven Plugin</a>.
* <a href="https://www.mojohaus.org/clirr-maven-plugin/">Clirr Maven Plugin</a>.
* <br/>
* See <a href="#defaultSince">defaultSince</a>.
*/
Expand Down Expand Up @@ -623,17 +622,14 @@ private void executeClirr() throws MavenInvocationException {

String clirrGoal = getFullClirrGoal();

// http://mojo.codehaus.org/clirr-maven-plugin/check-mojo.html
// https://www.mojohaus.org/clirr-maven-plugin/check-mojo.html
File clirrTextOutputFile = FileUtils.createTempFile(
"clirr", ".txt", new File(project.getBuild().getDirectory()));
Properties properties = new Properties();
properties.put("textOutputFile", clirrTextOutputFile.getAbsolutePath());
properties.put("comparisonVersion", comparisonVersion);
properties.put("failOnError", "false");
if (JavaVersion.JAVA_SPECIFICATION_VERSION.isBefore("8")) {
// ensure that Java7 picks up TLSv1.2 when connecting with Central
properties.put("https.protocols", "TLSv1.2");
}
properties.put("minSeverity", "info");

File invokerDir = new File(project.getBuild().getDirectory(), "invoker");
invokerDir.mkdirs();
Expand Down Expand Up @@ -715,7 +711,7 @@ private void parseClirrTextOutputFile(File clirrTextOutputFile) throws IOExcepti
continue;
}

// http://clirr.sourceforge.net/clirr-core/exegesis.html
// https://clirr.sourceforge.net/clirr-core/exegesis.html
// 7011 - Method Added
// 7012 - Method Added to Interface
// 8000 - Class Added
Expand Down
10 changes: 5 additions & 5 deletions src/site/apt/examples/fix-javadocs.apt.vm
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ Fixing Javadoc Comments
selective tags like author, version, etc.
You specify default value for some tags, for example, {{{../fix-mojo.html#defaultAuthor}\<defaultAuthor/\>}}.

The <javadoc:fix> goal can use Clirr ({{{http://clirr.sourceforge.net}}} via the
{{{http://mojo.codehaus.org/clirr-maven-plugin/}clirr-maven-plugin}} to add
The <javadoc:fix> goal can use Clirr ({{{https://clirr.sourceforge.net}}} via the
{{{https://www.mojohaus.org/clirr-maven-plugin/}clirr-maven-plugin}} to add
<@since> tags will be dynamically added for the current
project version. You need to add the <comparisonVersion> parameter (see below).

Expand Down Expand Up @@ -105,8 +105,8 @@ mvn javadoc:fix -DcomparisonVersion=1.0

** Using another Clirr version

By default, the <fix> and <test-fix> goals use the {{{https://www.mojohaus.org/clirr-maven-plugin}clirr-maven-plugin}},
version <<<2.2.2>>>. To use another version, you need to add a dependency in the Javadoc plugin as shown here:
By default, the <fix> and <test-fix> goals use the {{{https://www.mojohaus.org/clirr-maven-plugin/}clirr-maven-plugin}},
version <<<2.8>>>. To use another version, you need to add a dependency in the Javadoc plugin as shown here:

+-----+
<project>
Expand All @@ -124,7 +124,7 @@ mvn javadoc:fix -DcomparisonVersion=1.0
<dependency>
<groupId>org.codehaus.mojo</groupId>
<artifactId>clirr-maven-plugin</artifactId>
<version>2.3-SNAPSHOT</version>
<version>2.9-SNAPSHOT</version>
</dependency>
</dependencies>
</plugin>
Expand Down
Loading