Skip to content

Commit

Permalink
Prepare for Doxia 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-o committed Nov 12, 2023
1 parent 8c8d114 commit c45d748
Show file tree
Hide file tree
Showing 22 changed files with 33 additions and 46 deletions.
2 changes: 1 addition & 1 deletion maven-plugin-annotations/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-tools</artifactId>
<version>3.10.3-SNAPSHOT</version>
<version>3.11.0-SNAPSHOT</version>
</parent>

<artifactId>maven-plugin-annotations</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion maven-plugin-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-tools</artifactId>
<version>3.10.3-SNAPSHOT</version>
<version>3.11.0-SNAPSHOT</version>
</parent>

<groupId>org.apache.maven.plugins</groupId>
Expand Down
2 changes: 1 addition & 1 deletion maven-plugin-report-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-tools</artifactId>
<version>3.10.3-SNAPSHOT</version>
<version>3.11.0-SNAPSHOT</version>
</parent>

<groupId>org.apache.maven.plugins</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,21 +107,17 @@ protected MavenProject getProject() {
* {@inheritDoc}
*/
public boolean canGenerateReport() {
if (skip || skipReport) {
return false;
}

return true;
}

/**
* {@inheritDoc}
*/
protected void executeReport(Locale locale) throws MavenReportException {
if (!canGenerateReport()) {
return;
}
if (skip || skipReport) {
getLog().info("Maven Plugin Plugin Report generation skipped.");
return;
}

// Generate the plugin's documentation
generatePluginDocumentation(locale);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,6 @@ under the License.
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>@sitePluginVersion@</version>
<configuration>
<locales>en</locales>
</configuration>
</plugin>
</plugins>
</build>
Expand Down
2 changes: 1 addition & 1 deletion maven-plugin-report-plugin/src/it/plugin-report/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ under the License.
<artifactId>maven-site-plugin</artifactId>
<version>@sitePluginVersion@</version>
<configuration>
<locales>en,de,fr</locales>
<locales>default,de,fr</locales>
</configuration>
</plugin>
</plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,19 +101,15 @@ protected MavenProject getProject() {

/** {@inheritDoc} */
public boolean canGenerateReport() {
if (skip || skipReport) {
return false;
}

return true;
}

/** {@inheritDoc} */
protected void executeReport(Locale locale) throws MavenReportException {
if (!canGenerateReport()) {
return;
}
if (skip || skipReport) {
getLog().info("Maven Plugin Plugin Report generation skipped.");
return;
}

// Generate the plugin's documentation
generatePluginDocumentation(locale);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import org.apache.commons.lang3.StringUtils;
import org.apache.maven.doxia.sink.Sink;
import org.apache.maven.doxia.sink.impl.SinkEventAttributeSet.Semantics;
import org.apache.maven.doxia.util.HtmlTools;
import org.apache.maven.doxia.util.DoxiaUtils;
import org.apache.maven.plugin.descriptor.MojoDescriptor;
import org.apache.maven.plugin.descriptor.Parameter;
import org.apache.maven.plugin.logging.Log;
Expand Down Expand Up @@ -260,7 +260,7 @@ private void renderParameterOverviewTableRow(Parameter parameter) {
renderTableCellWithCode(
format("parameter.name", parameter.getName()),
// no need for additional URI encoding as it returns only URI safe characters
Optional.of("#" + HtmlTools.encodeId(parameter.getName())));
Optional.of("#" + DoxiaUtils.encodeId(parameter.getName())));

// type
Map.Entry<String, Optional<String>> type = getLinkedType(parameter, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ private void renderUsageSection(boolean hasMavenReport) {
sb.append(" ...").append(Markup.EOL);
sb.append("</project>");

verbatimText(sb.toString());
verbatimSource(sb.toString());

sink.paragraph();
linkPatternedText(getI18nString("configuration.end"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ public boolean canGenerateReport() {
@Override
protected void executeReport(Locale locale) throws MavenReportException {
if (skip) {
getLog().info("Maven Plugin Plugin Report generation skipped.");
return;
}

Expand Down Expand Up @@ -205,24 +204,23 @@ public String getOutputName() {
*/
private void generateMojosDocumentation(PluginDescriptor pluginDescriptor, Locale locale)
throws MavenReportException {

if (pluginDescriptor.getMojos() != null) {
for (MojoDescriptor descriptor : pluginDescriptor.getMojos()) {
GoalRenderer renderer;
try {
String filename = descriptor.getGoal() + "-mojo.html";
Sink sink = getSinkFactory().createSink(outputDirectory, filename);
Sink sink = getSinkFactory().createSink(getReportOutputDirectory(), filename);
renderer = new GoalRenderer(
sink,
i18n,
locale,
project,
descriptor,
outputDirectory,
getReportOutputDirectory(),
disableInternalJavadocLinkValidation,
getLog());
} catch (IOException e) {
throw new MavenReportException("Can not generate sink for mojo " + descriptor.getGoal(), e);
throw new MavenReportException("Cannot generate sink for mojo " + descriptor.getGoal(), e);
}
renderer.render();
}
Expand Down
2 changes: 1 addition & 1 deletion maven-plugin-tools-annotations/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-tools</artifactId>
<version>3.10.3-SNAPSHOT</version>
<version>3.11.0-SNAPSHOT</version>
</parent>

<artifactId>maven-plugin-tools-annotations</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion maven-plugin-tools-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-tools</artifactId>
<version>3.10.3-SNAPSHOT</version>
<version>3.11.0-SNAPSHOT</version>
</parent>

<artifactId>maven-plugin-tools-api</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion maven-plugin-tools-generators/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-tools</artifactId>
<version>3.10.3-SNAPSHOT</version>
<version>3.11.0-SNAPSHOT</version>
</parent>

<artifactId>maven-plugin-tools-generators</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
</li>
</ul>
<subsection name="Required Parameters">
<table border="0" class="bodyTable">
<table class="bodyTable">
<tr>
<th>Name</th>
<th>Type</th>
Expand Down Expand Up @@ -81,7 +81,7 @@
</table>
</subsection>
<subsection name="Optional Parameters">
<table border="0" class="bodyTable">
<table class="bodyTable">
<tr>
<th>Name</th>
<th>Type</th>
Expand Down Expand Up @@ -109,7 +109,7 @@
<subsection name="Parameter Details">
<h4>
<strong>
<a name="dir">&lt;dir&gt;</a>
<a id="dir">&lt;dir&gt;</a>
</strong>
</h4>
<div>Test parameter description</div>
Expand Down Expand Up @@ -142,7 +142,7 @@
<hr/>
<h4>
<strong>
<a name="withoutSince">&lt;withoutSince&gt;</a>
<a id="withoutSince">&lt;withoutSince&gt;</a>
</strong>
</h4>
<div>(no description)</div>
Expand Down
2 changes: 1 addition & 1 deletion maven-plugin-tools-java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-tools</artifactId>
<version>3.10.3-SNAPSHOT</version>
<version>3.11.0-SNAPSHOT</version>
</parent>

<artifactId>maven-plugin-tools-java</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion maven-script/maven-plugin-tools-ant/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-script</artifactId>
<version>3.10.3-SNAPSHOT</version>
<version>3.11.0-SNAPSHOT</version>
</parent>

<artifactId>maven-plugin-tools-ant</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion maven-script/maven-plugin-tools-beanshell/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-script</artifactId>
<version>3.10.3-SNAPSHOT</version>
<version>3.11.0-SNAPSHOT</version>
</parent>

<artifactId>maven-plugin-tools-beanshell</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion maven-script/maven-plugin-tools-model/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-script</artifactId>
<version>3.10.3-SNAPSHOT</version>
<version>3.11.0-SNAPSHOT</version>
</parent>

<artifactId>maven-plugin-tools-model</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion maven-script/maven-script-ant/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ under the License.
<parent>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-script</artifactId>
<version>3.10.3-SNAPSHOT</version>
<version>3.11.0-SNAPSHOT</version>
</parent>

<artifactId>maven-script-ant</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion maven-script/maven-script-beanshell/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ under the License.
<parent>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-script</artifactId>
<version>3.10.3-SNAPSHOT</version>
<version>3.11.0-SNAPSHOT</version>
</parent>

<artifactId>maven-script-beanshell</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion maven-script/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ under the License.
<parent>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-tools</artifactId>
<version>3.10.3-SNAPSHOT</version>
<version>3.11.0-SNAPSHOT</version>
</parent>

<artifactId>maven-script</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-tools</artifactId>
<version>3.10.3-SNAPSHOT</version>
<version>3.11.0-SNAPSHOT</version>
<packaging>pom</packaging>

<name>Maven Plugin Tools</name>
Expand Down

0 comments on commit c45d748

Please sign in to comment.