You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mi...@apache.org on 2023/05/09 22:03:16 UTC
[maven-plugin-tools] branch fixes created (now 478b2f94)
This is an automated email from the ASF dual-hosted git repository.
michaelo pushed a change to branch fixes
in repository https://gitbox.apache.org/repos/asf/maven-plugin-tools.git
at 478b2f94 [MPLUGIN-472] Use Plexus I18N rathen than fiddling with resource bundles directly
This branch includes the following new commits:
new 0438bcdb [MPLUGIN-467] Remove reporting from maven-plugin-plugin
new 69391f92 [MPLUGIN-468] Upgrade plugins and components (in ITs)
new e173b167 [MPLUGIN-469] Omit empty line in generated help goal output if plugin description is empty
new d8d3a267 [MPLUGIN-470] *-mojo.xml (in PluginXdocGenerator) is overwritten when multiple locales are defined
new 946934f0 [MPLUGIN-471] Generated table by PluginXdocGenerator does not contain default attributes
new 86827b1f Simplify code
new 2994cb3c Remove superfluous site descriptor
new 478b2f94 [MPLUGIN-472] Use Plexus I18N rathen than fiddling with resource bundles directly
The 8 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[maven-plugin-tools] 07/08: Remove superfluous site descriptor
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
michaelo pushed a commit to branch fixes
in repository https://gitbox.apache.org/repos/asf/maven-plugin-tools.git
commit 2994cb3cbc9250dba18c6abec969d1c819e46dd5
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Tue May 9 23:41:34 2023 +0200
Remove superfluous site descriptor
---
.../src/site/site.xml | 30 ----------------------
1 file changed, 30 deletions(-)
diff --git a/maven-plugin-report-plugin/src/it/plugin-info-jdk-default-version/src/site/site.xml b/maven-plugin-report-plugin/src/it/plugin-info-jdk-default-version/src/site/site.xml
deleted file mode 100644
index c0a8d7a2..00000000
--- a/maven-plugin-report-plugin/src/it/plugin-info-jdk-default-version/src/site/site.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied. See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<project xmlns="http://maven.apache.org/DECORATION/1.8.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/DECORATION/1.8.0 https://maven.apache.org/xsd/decoration-1.8.0.xsd">
- <body>
- <menu name="Overview">
- <item name="Goals" href="plugin-info.html"/>
- </menu>
- <menu ref="reports" inherit="bottom" />
- </body>
-</project>
[maven-plugin-tools] 01/08: [MPLUGIN-467] Remove reporting from maven-plugin-plugin
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
michaelo pushed a commit to branch fixes
in repository https://gitbox.apache.org/repos/asf/maven-plugin-tools.git
commit 0438bcdbfa449f92a81f0fcc988d37052feb647a
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Tue May 9 16:14:29 2023 +0200
[MPLUGIN-467] Remove reporting from maven-plugin-plugin
---
maven-plugin-plugin/pom.xml | 18 -
.../plugin/plugin/report_old/PluginReport.java | 759 ---------------------
.../plugin/plugin/report_old/Requirements.java | 86 ---
.../plugin/report_old/RequirementsHistory.java | 64 --
.../EnhancedPluginDescriptorBuilder.java | 97 ---
.../src/main/resources/plugin-report.properties | 54 --
.../src/main/resources/plugin-report_de.properties | 54 --
.../src/main/resources/plugin-report_en.properties | 23 -
.../src/main/resources/plugin-report_fr.properties | 54 --
.../src/main/resources/plugin-report_sv.properties | 54 --
maven-plugin-report-plugin/pom.xml | 8 +-
.../src/it/mplugin-187/invoker.properties | 6 +-
.../src/it/mplugin-187/pom.xml | 6 +-
maven-plugin-tools-generators/pom.xml | 1 -
pom.xml | 31 +-
15 files changed, 16 insertions(+), 1299 deletions(-)
diff --git a/maven-plugin-plugin/pom.xml b/maven-plugin-plugin/pom.xml
index b354b7ed..d2424d3b 100644
--- a/maven-plugin-plugin/pom.xml
+++ b/maven-plugin-plugin/pom.xml
@@ -93,16 +93,6 @@
<optional>true</optional>
</dependency>
- <!-- doxia -->
- <dependency>
- <groupId>org.apache.maven.doxia</groupId>
- <artifactId>doxia-sink-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.maven.doxia</groupId>
- <artifactId>doxia-site-renderer</artifactId>
- </dependency>
-
<!-- Maven -->
<dependency>
<groupId>org.apache.maven</groupId>
@@ -126,12 +116,6 @@
<scope>provided</scope>
</dependency>
- <!-- shared -->
- <dependency>
- <groupId>org.apache.maven.reporting</groupId>
- <artifactId>maven-reporting-impl</artifactId>
- </dependency>
-
<!-- plexus -->
<dependency>
<groupId>org.codehaus.plexus</groupId>
@@ -291,8 +275,6 @@
<streamLogsOnFailures>true</streamLogsOnFailures>
<showErrors>true</showErrors>
<filterProperties>
- <sitePluginVersion>3.12.1</sitePluginVersion>
- <projectInfoReportsPlugin>3.4.1</projectInfoReportsPlugin>
<antVersion>${antVersion}</antVersion>
</filterProperties>
<properties>
diff --git a/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/report_old/PluginReport.java b/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/report_old/PluginReport.java
deleted file mode 100644
index ae3ffe85..00000000
--- a/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/report_old/PluginReport.java
+++ /dev/null
@@ -1,759 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.maven.plugin.plugin.report_old;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.Reader;
-import java.nio.file.Files;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.ResourceBundle;
-
-import org.apache.maven.doxia.sink.Sink;
-import org.apache.maven.model.Plugin;
-import org.apache.maven.plugin.descriptor.MojoDescriptor;
-import org.apache.maven.plugin.descriptor.PluginDescriptor;
-import org.apache.maven.plugin.descriptor.PluginDescriptorBuilder;
-import org.apache.maven.plugin.plugin.DescriptorGeneratorMojo;
-import org.apache.maven.plugins.annotations.Component;
-import org.apache.maven.plugins.annotations.Execute;
-import org.apache.maven.plugins.annotations.LifecyclePhase;
-import org.apache.maven.plugins.annotations.Mojo;
-import org.apache.maven.plugins.annotations.Parameter;
-import org.apache.maven.plugins.plugin.descriptor_old.EnhancedPluginDescriptorBuilder;
-import org.apache.maven.project.MavenProject;
-import org.apache.maven.reporting.AbstractMavenReport;
-import org.apache.maven.reporting.AbstractMavenReportRenderer;
-import org.apache.maven.reporting.MavenReportException;
-import org.apache.maven.rtinfo.RuntimeInformation;
-import org.apache.maven.tools.plugin.DefaultPluginToolsRequest;
-import org.apache.maven.tools.plugin.PluginToolsRequest;
-import org.apache.maven.tools.plugin.generator.GeneratorException;
-import org.apache.maven.tools.plugin.generator.GeneratorUtils;
-import org.apache.maven.tools.plugin.generator.PluginXdocGenerator;
-import org.apache.maven.tools.plugin.util.PluginUtils;
-import org.codehaus.plexus.configuration.PlexusConfigurationException;
-import org.codehaus.plexus.util.StringUtils;
-import org.codehaus.plexus.util.xml.XmlStreamReader;
-import org.codehaus.plexus.util.xml.Xpp3Dom;
-
-/**
- * Generates the Plugin's documentation report: <code>plugin-info.html</code> plugin overview page,
- * and one <code><i>goal</i>-mojo.html</code> per goal.
- * Relies on one output file from {@link DescriptorGeneratorMojo}.
- *
- * @author <a href="snicoll@apache.org">Stephane Nicoll</a>
- * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
- * @since 2.0
- * @deprecated use the maven-plugin-report-plugin instead
- */
-@Deprecated
-@Mojo(name = "report", threadSafe = true)
-@Execute(phase = LifecyclePhase.PROCESS_CLASSES)
-public class PluginReport extends AbstractMavenReport {
- /**
- * Report output directory for mojos' documentation.
- */
- @Parameter(defaultValue = "${project.build.directory}/generated-site/xdoc")
- private File outputDirectory;
-
- /**
- * The file encoding of the source files.
- *
- * @deprecated not used in report, will be removed in the next major version
- *
- * @since 2.7
- */
- @Deprecated
- @Parameter(property = "encoding", defaultValue = "${project.build.sourceEncoding}")
- private String encoding;
-
- /**
- * Specify some requirements to execute this plugin.
- * Example:
- * <pre>
- * <requirements>
- * <maven>2.0</maven>
- * <jdk>1.4</jdk>
- * <memory>256m</memory>
- * <diskSpace>1m</diskSpace>
- * <others>
- * <property>
- * <name>SVN</name>
- * <value>1.4.6</value>
- * </property>
- * </others>
- * </requirements>
- * </pre>
- * <p>
- * If not is specified, Maven requirement is extracted from
- * <code><project><prerequisites><maven></code>
- * and JDK requirement is extracted from maven-compiler-plugin configuration.
- *
- * @deprecated will be removed in the next major version, please don't use
- */
- @Deprecated
- @Parameter
- private Requirements requirements;
-
- /**
- * <p>
- * The goal prefix that will appear before the ":".
- * By default, this plugin applies a heuristic to derive a heuristic from
- * the plugin's artifactId.
- * </p>
- * <p>
- * It removes any occurrences of the regular expression <strong>-?maven-?</strong>,
- * and then removes any occurrences of <strong>-?plugin-?</strong>.
- * </p>
- * <p>
- * For example, horsefeature-maven-plugin becomes horsefeature.
- * </p>
- * <p>
- * (There is a special case for maven-plugin-plugin: it is mapped to 'plugin')
- * </p>
- *
- * @deprecated not used in report, will be removed in the next major version
- *
- * @since 2.4
- */
- @Deprecated
- @Parameter(property = "goalPrefix")
- protected String goalPrefix;
-
- /**
- * Set this to "true" to skip invoking any goals or reports of the plugin.
- *
- * @deprecated use {@link #skip} parameter instead
- *
- * @since 2.8
- */
- @Deprecated
- @Parameter(defaultValue = "false", property = "maven.plugin.skip")
- private boolean skipReport;
-
- /**
- * Set this to "true" to skip generating the report.
- *
- * @since 2.8
- */
- @Parameter(defaultValue = "false", property = "maven.plugin.report.skip")
- private boolean skip;
-
- /**
- * Set this to "true" to generate the usage section for "plugin-info.html" with
- * {@code <extensions>true</extensions>}.
- *
- * @since 3.7.0
- */
- @Parameter(defaultValue = "false", property = "maven.plugin.report.hasExtensionsToLoad")
- private boolean hasExtensionsToLoad;
-
- /**
- * The Plugin requirements history list.
- * <p>
- * Can be specified as list of <code>requirementsHistory</code>:
- *
- * <pre>
- * <requirementsHistories>
- * <requirementsHistory>
- * <version>plugin version</version>
- * <maven>maven version</maven>
- * <jdk>jdk version</jdk>
- * </requirementsHistory>
- * </requirementsHistories>
- * </pre>
- *
- * @since 3.7.0
- */
- @Parameter
- private List<RequirementsHistory> requirementsHistories = new ArrayList<>();
-
- /**
- * @since 3.5.1
- */
- @Component
- private RuntimeInformation rtInfo;
-
- /**
- * Path to {@code plugin.xml} plugin descriptor to generate the report from.
- *
- * @since 3.5.1
- * @deprecated No longer evaluated, use {@link #enhancedPluginXmlFile}.
- */
- @Parameter(
- defaultValue = "${project.build.outputDirectory}/META-INF/maven/plugin.xml",
- required = true,
- readonly = true)
- @Deprecated
- private File pluginXmlFile;
-
- /**
- * Path to enhanced plugin descriptor to generate the report from (must contain some XHTML values)
- *
- * @since 3.7.0
- */
- @Parameter(defaultValue = "${project.build.directory}/plugin-enhanced.xml", required = true, readonly = true)
- private File enhancedPluginXmlFile;
-
- /**
- * In case the internal javadoc site has not been generated when running this report goal
- * (e.g. when using an aggregator javadoc report) link validation needs to be disabled by setting
- * this value to {@code true}.
- * This might have the drawback that some links being generated in the report might be broken
- * in case not all parameter types and javadoc link references are resolvable through the sites being given to
- * {@link DescriptorGeneratorMojo}.
- *
- * @since 3.7.0
- */
- @Parameter(property = "maven.plugin.report.disableInternalJavadocLinkValidation")
- private boolean disableInternalJavadocLinkValidation;
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected String getOutputDirectory() {
- // PLUGIN-191: output directory of plugin.html, not *-mojo.xml
- return project.getReporting().getOutputDirectory();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean canGenerateReport() {
- return enhancedPluginXmlFile != null && enhancedPluginXmlFile.isFile() && enhancedPluginXmlFile.canRead();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void executeReport(Locale locale) throws MavenReportException {
- getLog().warn("The 'report' goal of the maven-plugin-plugin is deprecated, please use "
- + "the 'report' goal from the maven-plugin-report-plugin instead. This goal will be removed "
- + "in version 4.0.0.");
-
- if (skip || skipReport) {
- getLog().info("Maven Plugin Plugin Report generation skipped.");
- return;
- }
-
- PluginDescriptor pluginDescriptor = extractPluginDescriptor();
-
- // Generate the mojos' documentation
- generateMojosDocumentation(pluginDescriptor, locale);
-
- // Write the overview
- PluginOverviewRenderer r = new PluginOverviewRenderer(
- getProject(),
- requirements,
- requirementsHistories,
- getSink(),
- pluginDescriptor,
- locale,
- hasExtensionsToLoad);
- r.render();
- }
-
- private PluginDescriptor extractPluginDescriptor() throws MavenReportException {
- PluginDescriptorBuilder builder = new EnhancedPluginDescriptorBuilder(rtInfo);
-
- try (Reader input = new XmlStreamReader(Files.newInputStream(enhancedPluginXmlFile.toPath()))) {
- return builder.build(input);
- } catch (IOException | PlexusConfigurationException e) {
- throw new MavenReportException("Error extracting plugin descriptor from " + enhancedPluginXmlFile, e);
- }
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public String getDescription(Locale locale) {
- return getBundle(locale).getString("report.plugin.description");
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public String getName(Locale locale) {
- return getBundle(locale).getString("report.plugin.name");
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public String getOutputName() {
- return "plugin-info";
- }
-
- /**
- * Generate the mojos documentation, as xdoc files.
- *
- * @param pluginDescriptor not null
- * @param locale not null
- * @throws MavenReportException if any
- */
- private void generateMojosDocumentation(PluginDescriptor pluginDescriptor, Locale locale)
- throws MavenReportException {
- try {
- File outputDir = outputDirectory;
- outputDir.mkdirs();
-
- PluginXdocGenerator generator = new PluginXdocGenerator(
- getProject(), locale, getReportOutputDirectory(), disableInternalJavadocLinkValidation);
- PluginToolsRequest pluginToolsRequest = new DefaultPluginToolsRequest(getProject(), pluginDescriptor);
- generator.execute(outputDir, pluginToolsRequest);
- } catch (GeneratorException e) {
- throw new MavenReportException("Error writing plugin documentation", e);
- }
- }
-
- /**
- * @param locale not null
- * @return the bundle for this report
- */
- protected static ResourceBundle getBundle(Locale locale) {
- return ResourceBundle.getBundle("plugin-report", locale, PluginReport.class.getClassLoader());
- }
-
- /**
- * Generates an overview page with the list of goals
- * and a link to the goal's page.
- */
- static class PluginOverviewRenderer extends AbstractMavenReportRenderer {
- private final MavenProject project;
-
- private final Requirements requirements;
-
- private final List<RequirementsHistory> requirementsHistories;
-
- private final PluginDescriptor pluginDescriptor;
-
- private final Locale locale;
-
- private final boolean hasExtensionsToLoad;
-
- /**
- * @param project not null
- * @param requirements not null
- * @param requirementsHistories not null
- * @param sink not null
- * @param pluginDescriptor not null
- * @param locale not null
- */
- PluginOverviewRenderer(
- MavenProject project,
- Requirements requirements,
- List<RequirementsHistory> requirementsHistories,
- Sink sink,
- PluginDescriptor pluginDescriptor,
- Locale locale,
- boolean hasExtensionsToLoad) {
- super(sink);
-
- this.project = project;
-
- this.requirements = (requirements == null ? new Requirements() : requirements);
-
- this.requirementsHistories = requirementsHistories;
-
- this.pluginDescriptor = pluginDescriptor;
-
- this.locale = locale;
-
- this.hasExtensionsToLoad = hasExtensionsToLoad;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public String getTitle() {
- return getBundle(locale).getString("report.plugin.title");
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void renderBody() {
- startSection(getTitle());
-
- if (!(pluginDescriptor.getMojos() != null
- && pluginDescriptor.getMojos().size() > 0)) {
- paragraph(getBundle(locale).getString("report.plugin.goals.nogoal"));
- endSection();
- return;
- }
-
- paragraph(getBundle(locale).getString("report.plugin.goals.intro"));
-
- boolean hasMavenReport = false;
- for (Iterator<MojoDescriptor> i = pluginDescriptor.getMojos().iterator(); i.hasNext(); ) {
- MojoDescriptor mojo = i.next();
-
- if (GeneratorUtils.isMavenReport(mojo.getImplementation(), project)) {
- hasMavenReport = true;
- }
- }
-
- startTable();
-
- String goalColumnName = getBundle(locale).getString("report.plugin.goals.column.goal");
- String isMavenReport = getBundle(locale).getString("report.plugin.goals.column.isMavenReport");
- String descriptionColumnName = getBundle(locale).getString("report.plugin.goals.column.description");
- if (hasMavenReport) {
- tableHeader(new String[] {goalColumnName, isMavenReport, descriptionColumnName});
- } else {
- tableHeader(new String[] {goalColumnName, descriptionColumnName});
- }
-
- List<MojoDescriptor> mojos = new ArrayList<>();
- mojos.addAll(pluginDescriptor.getMojos());
- PluginUtils.sortMojos(mojos);
- for (MojoDescriptor mojo : mojos) {
- String goalName = mojo.getFullGoalName();
-
- /*
- * Added ./ to define a relative path
- * @see AbstractMavenReportRenderer#getValidHref(java.lang.String)
- */
- String goalDocumentationLink = "./" + mojo.getGoal() + "-mojo.html";
-
- String description;
- if (StringUtils.isNotEmpty(mojo.getDeprecated())) {
- description = "<strong>" + getBundle(locale).getString("report.plugin.goal.deprecated")
- + "</strong> " + mojo.getDeprecated();
- } else if (StringUtils.isNotEmpty(mojo.getDescription())) {
- description = mojo.getDescription();
- } else {
- description = getBundle(locale).getString("report.plugin.goal.nodescription");
- }
-
- sink.tableRow();
- tableCell(createLinkPatternedText(goalName, goalDocumentationLink));
- if (hasMavenReport) {
- if (GeneratorUtils.isMavenReport(mojo.getImplementation(), project)) {
- sink.tableCell();
- sink.text(getBundle(locale).getString("report.plugin.isReport"));
- sink.tableCell_();
- } else {
- sink.tableCell();
- sink.text(getBundle(locale).getString("report.plugin.isNotReport"));
- sink.tableCell_();
- }
- }
- tableCell(description, true);
- sink.tableRow_();
- }
-
- endTable();
-
- startSection(getBundle(locale).getString("report.plugin.systemrequirements"));
-
- paragraph(getBundle(locale).getString("report.plugin.systemrequirements.intro"));
-
- startTable();
-
- String maven = discoverMavenRequirement(project, requirements);
- sink.tableRow();
- tableCell(getBundle(locale).getString("report.plugin.systemrequirements.maven"));
- tableCell(
- (maven != null
- ? maven
- : getBundle(locale).getString("report.plugin.systemrequirements.nominimum")));
- sink.tableRow_();
-
- String jdk = discoverJdkRequirement(project, requirements);
- sink.tableRow();
- tableCell(getBundle(locale).getString("report.plugin.systemrequirements.jdk"));
- tableCell((jdk != null ? jdk : getBundle(locale).getString("report.plugin.systemrequirements.nominimum")));
- sink.tableRow_();
-
- String memory = requirements.getMemory();
- if (StringUtils.isNotEmpty(memory)) {
- sink.tableRow();
- tableCell(getBundle(locale).getString("report.plugin.systemrequirements.memory"));
- tableCell(memory);
- sink.tableRow_();
- }
-
- String diskSpace = requirements.getDiskSpace();
- if (StringUtils.isNotEmpty(diskSpace)) {
- sink.tableRow();
- tableCell(getBundle(locale).getString("report.plugin.systemrequirements.diskspace"));
- tableCell(diskSpace);
- sink.tableRow_();
- }
-
- if (requirements.getOthers() != null && requirements.getOthers().size() > 0) {
- for (Iterator it = requirements.getOthers().keySet().iterator(); it.hasNext(); ) {
- String key = it.next().toString();
-
- sink.tableRow();
- tableCell(key);
- tableCell(
- (StringUtils.isNotEmpty(requirements.getOthers().getProperty(key))
- ? requirements.getOthers().getProperty(key)
- : getBundle(locale).getString("report.plugin.systemrequirements.nominimum")));
- sink.tableRow_();
- }
- }
- endTable();
-
- endSection();
-
- renderRequirementsHistories();
-
- renderUsageSection(hasMavenReport);
-
- endSection();
- }
-
- private void renderRequirementsHistories() {
- if (requirementsHistories.isEmpty()) {
- return;
- }
-
- startSection(getBundle(locale).getString("report.plugin.systemrequirements.history"));
- paragraph(getBundle(locale).getString("report.plugin.systemrequirements.history.intro"));
-
- startTable();
- tableHeader(new String[] {
- getBundle(locale).getString("report.plugin.systemrequirements.history.version"),
- getBundle(locale).getString("report.plugin.systemrequirements.history.maven"),
- getBundle(locale).getString("report.plugin.systemrequirements.history.jdk")
- });
-
- requirementsHistories.forEach(requirementsHistory -> {
- sink.tableRow();
- tableCell(requirementsHistory.getVersion());
- tableCell(requirementsHistory.getMaven());
- tableCell(requirementsHistory.getJdk());
- sink.tableRow_();
- });
- endTable();
-
- endSection();
- }
-
- /**
- * Render the section about the usage of the plugin.
- *
- * @param hasMavenReport If the plugin has a report or not
- */
- private void renderUsageSection(boolean hasMavenReport) {
- startSection(getBundle(locale).getString("report.plugin.usage"));
-
- // Configuration
- sink.paragraph();
- text(getBundle(locale).getString("report.plugin.usage.intro"));
- sink.paragraph_();
-
- StringBuilder sb = new StringBuilder();
- sb.append("<project>").append('\n');
- sb.append(" ...").append('\n');
- sb.append(" <build>").append('\n');
- sb.append(" <!-- " + getBundle(locale).getString("report.plugin.usage.pluginManagement") + " -->")
- .append('\n');
- sb.append(" <pluginManagement>").append('\n');
- sb.append(" <plugins>").append('\n');
- sb.append(" <plugin>").append('\n');
- sb.append(" <groupId>")
- .append(pluginDescriptor.getGroupId())
- .append("</groupId>")
- .append('\n');
- sb.append(" <artifactId>")
- .append(pluginDescriptor.getArtifactId())
- .append("</artifactId>")
- .append('\n');
- sb.append(" <version>")
- .append(pluginDescriptor.getVersion())
- .append("</version>")
- .append('\n');
- if (hasExtensionsToLoad) {
- sb.append(" <extensions>true</extensions>").append('\n');
- }
- sb.append(" </plugin>").append('\n');
- sb.append(" ...").append('\n');
- sb.append(" </plugins>").append('\n');
- sb.append(" </pluginManagement>").append('\n');
- sb.append(" <!-- " + getBundle(locale).getString("report.plugin.usage.plugins") + " -->")
- .append('\n');
- sb.append(" <plugins>").append('\n');
- sb.append(" <plugin>").append('\n');
- sb.append(" <groupId>")
- .append(pluginDescriptor.getGroupId())
- .append("</groupId>")
- .append('\n');
- sb.append(" <artifactId>")
- .append(pluginDescriptor.getArtifactId())
- .append("</artifactId>")
- .append('\n');
- sb.append(" </plugin>").append('\n');
- sb.append(" ...").append('\n');
- sb.append(" </plugins>").append('\n');
- sb.append(" </build>").append('\n');
-
- if (hasMavenReport) {
- sb.append(" ...").append('\n');
- sb.append(" <!-- " + getBundle(locale).getString("report.plugin.usage.reporting") + " -->")
- .append('\n');
- sb.append(" <reporting>").append('\n');
- sb.append(" <plugins>").append('\n');
- sb.append(" <plugin>").append('\n');
- sb.append(" <groupId>")
- .append(pluginDescriptor.getGroupId())
- .append("</groupId>")
- .append('\n');
- sb.append(" <artifactId>")
- .append(pluginDescriptor.getArtifactId())
- .append("</artifactId>")
- .append('\n');
- sb.append(" <version>")
- .append(pluginDescriptor.getVersion())
- .append("</version>")
- .append('\n');
- sb.append(" </plugin>").append('\n');
- sb.append(" ...").append('\n');
- sb.append(" </plugins>").append('\n');
- sb.append(" </reporting>").append('\n');
- }
-
- sb.append(" ...").append('\n');
- sb.append("</project>").append('\n');
-
- verbatimText(sb.toString());
-
- sink.paragraph();
- linkPatternedText(getBundle(locale).getString("report.plugin.configuration.end"));
- sink.paragraph_();
-
- endSection();
- }
-
- /**
- * Try to lookup on the Maven prerequisites property.
- * If not specified, uses the value defined by the user.
- *
- * @param project not null
- * @param requirements not null
- * @return the Maven version
- */
- private static String discoverMavenRequirement(MavenProject project, Requirements requirements) {
- String maven = requirements.getMaven();
- if (maven == null) {
- maven = (project.getPrerequisites() != null
- ? project.getPrerequisites().getMaven()
- : null);
- }
- if (maven == null) {
- maven = "2.0";
- }
-
- return maven;
- }
-
- /**
- * <ol>
- * <li>use configured jdk requirement</li>
- * <li>use <code>target</code> configuration of <code>org.apache.maven.plugins:maven-compiler-plugin</code></li>
- * <li>use <code>target</code> configuration of <code>org.apache.maven.plugins:maven-compiler-plugin</code> in
- * <code>pluginManagement</code></li>
- * <li>use <code>maven.compiler.target</code> property</li>
- * </ol>
- *
- * @param project not null
- * @param requirements not null
- * @return the JDK version
- */
- private static String discoverJdkRequirement(MavenProject project, Requirements requirements) {
- String jdk = requirements.getJdk();
-
- if (jdk != null) {
- return jdk;
- }
-
- Plugin compiler = getCompilerPlugin(project.getBuild().getPluginsAsMap());
- if (compiler == null) {
- compiler = getCompilerPlugin(project.getPluginManagement().getPluginsAsMap());
- }
-
- jdk = getPluginParameter(compiler, "release");
- if (jdk != null) {
- return jdk;
- }
-
- jdk = project.getProperties().getProperty("maven.compiler.release");
- if (jdk != null) {
- return jdk;
- }
-
- jdk = getPluginParameter(compiler, "target");
- if (jdk != null) {
- return jdk;
- }
-
- // default value
- jdk = project.getProperties().getProperty("maven.compiler.target");
- if (jdk != null) {
- return jdk;
- }
-
- // return "1.5" by default?
-
- String version = (compiler == null) ? null : compiler.getVersion();
-
- if (version != null) {
- return "Default target for maven-compiler-plugin version " + version;
- }
-
- return "Unknown";
- }
-
- private static Plugin getCompilerPlugin(Map<String, Plugin> pluginsAsMap) {
- return pluginsAsMap.get("org.apache.maven.plugins:maven-compiler-plugin");
- }
-
- private static String getPluginParameter(Plugin plugin, String parameter) {
- if (plugin != null) {
- Xpp3Dom pluginConf = (Xpp3Dom) plugin.getConfiguration();
-
- if (pluginConf != null) {
- Xpp3Dom target = pluginConf.getChild(parameter);
-
- if (target != null) {
- return target.getValue();
- }
- }
- }
-
- return null;
- }
- }
-}
diff --git a/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/report_old/Requirements.java b/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/report_old/Requirements.java
deleted file mode 100644
index c5302f42..00000000
--- a/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/report_old/Requirements.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.maven.plugin.plugin.report_old;
-
-import java.util.Properties;
-
-/**
- * Plugin requirements.
- *
- * @deprecated will be removed in the next major version
- */
-@Deprecated
-public class Requirements {
- /**
- * The minimum version of Maven to run this plugin.
- */
- private String maven;
-
- /**
- * The minimum version of the JDK to run this plugin.
- */
- private String jdk;
-
- /**
- * The minimum memory needed to run this plugin.
- */
- private String memory;
-
- /**
- * The minimum diskSpace needed to run this plugin.
- */
- private String diskSpace;
-
- /**
- * Field others.
- */
- private java.util.Properties others;
-
- public String getMaven() {
- return maven;
- }
-
- public String getJdk() {
- return jdk;
- }
-
- public String getMemory() {
- return memory;
- }
-
- public String getDiskSpace() {
- return diskSpace;
- }
-
- public Properties getOthers() {
- return others;
- }
-
- @Override
- public String toString() {
- final StringBuilder sb = new StringBuilder("Requirements{");
- sb.append("maven='").append(maven).append('\'');
- sb.append(", jdk='").append(jdk).append('\'');
- sb.append(", memory='").append(memory).append('\'');
- sb.append(", diskSpace='").append(diskSpace).append('\'');
- sb.append(", others=").append(others);
- sb.append('}');
- return sb.toString();
- }
-}
diff --git a/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/report_old/RequirementsHistory.java b/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/report_old/RequirementsHistory.java
deleted file mode 100644
index 974b3dfd..00000000
--- a/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/report_old/RequirementsHistory.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.maven.plugin.plugin.report_old;
-
-/**
- * Plugin requirements history.
- *
- * @author Slawomir Jaranowski
- */
-@Deprecated
-public class RequirementsHistory {
- /**
- * The plugin version.
- */
- private String version;
-
- /**
- * The minimum version of Maven to run this plugin.
- */
- private String maven;
-
- /**
- * The minimum version of the JDK to run this plugin.
- */
- private String jdk;
-
- public String getVersion() {
- return version;
- }
-
- public String getMaven() {
- return maven;
- }
-
- public String getJdk() {
- return jdk;
- }
-
- @Override
- public String toString() {
- final StringBuilder sb = new StringBuilder("RequirementsHistory{");
- sb.append("version='").append(version).append('\'');
- sb.append(", maven='").append(maven).append('\'');
- sb.append(", jdk='").append(jdk).append('\'');
- sb.append('}');
- return sb.toString();
- }
-}
diff --git a/maven-plugin-plugin/src/main/java/org/apache/maven/plugins/plugin/descriptor_old/EnhancedPluginDescriptorBuilder.java b/maven-plugin-plugin/src/main/java/org/apache/maven/plugins/plugin/descriptor_old/EnhancedPluginDescriptorBuilder.java
deleted file mode 100644
index c62b9e7c..00000000
--- a/maven-plugin-plugin/src/main/java/org/apache/maven/plugins/plugin/descriptor_old/EnhancedPluginDescriptorBuilder.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.maven.plugins.plugin.descriptor_old;
-
-import java.net.URI;
-
-import org.apache.maven.plugin.descriptor.MojoDescriptor;
-import org.apache.maven.plugin.descriptor.Parameter;
-import org.apache.maven.plugin.descriptor.PluginDescriptor;
-import org.apache.maven.plugin.descriptor.PluginDescriptorBuilder;
-import org.apache.maven.plugin.plugin.report_old.PluginReport;
-import org.apache.maven.rtinfo.RuntimeInformation;
-import org.apache.maven.tools.plugin.EnhancedParameterWrapper;
-import org.codehaus.plexus.configuration.PlexusConfiguration;
-import org.codehaus.plexus.configuration.PlexusConfigurationException;
-
-/**
- * Reads enhanced plugin.xml files as generated by
- * {@link org.apache.maven.tools.plugin.generator.PluginDescriptorFilesGenerator} and
- * used by {@link PluginReport}.
- * Populates the slightly extended {@link Parameter} object {@link EnhancedParameterWrapper}.
- */
-@Deprecated
-public class EnhancedPluginDescriptorBuilder extends PluginDescriptorBuilder {
- private final boolean requireAddingMissingParameterSinceField;
-
- public EnhancedPluginDescriptorBuilder(RuntimeInformation rtInfo) {
- this(rtInfo.isMavenVersion("[,3.3.9]"));
- }
-
- EnhancedPluginDescriptorBuilder(boolean requireAddingMissingParameterSinceField) {
- this.requireAddingMissingParameterSinceField = requireAddingMissingParameterSinceField;
- }
-
- @Override
- public MojoDescriptor buildComponentDescriptor(PlexusConfiguration c, PluginDescriptor pluginDescriptor)
- throws PlexusConfigurationException {
- MojoDescriptor mojoDescriptor = super.buildComponentDescriptor(c, pluginDescriptor);
-
- // ----------------------------------------------------------------------
- // Parameters
- // ----------------------------------------------------------------------
-
- PlexusConfiguration[] parameterConfigurations = c.getChild("parameters").getChildren("parameter");
-
- for (PlexusConfiguration d : parameterConfigurations) {
- String parameterName = d.getChild("name").getValue();
- // don't call getParameterMap() to not populate
- Parameter pd = mojoDescriptor.getParameterMap().get(parameterName);
- if (requireAddingMissingParameterSinceField) {
- addMissingParameterSinceField(pd, d);
- }
- PlexusConfiguration configTypeJavadocUrl = d.getChild("typeJavadocUrl", false);
- if (configTypeJavadocUrl != null) {
- String parameterTypeJavadocUrl = configTypeJavadocUrl.getValue();
- EnhancedParameterWrapper enhancedParameter = new EnhancedParameterWrapper(pd);
- enhancedParameter.setTypeJavadocUrl(URI.create(parameterTypeJavadocUrl));
- mojoDescriptor
- .getParameters()
- .set(mojoDescriptor.getParameters().indexOf(pd), enhancedParameter);
- mojoDescriptor.getParameterMap().put(parameterName, enhancedParameter);
- }
- }
- return mojoDescriptor;
- }
-
- /**
- * Reads the plugin descriptor and adds the fix for <a href="https://issues.apache.org/jira/browse/MNG-6109">
- * MNG-6109</a> when using Maven-3.3.9 and before.
- * Method can be removed once Maven 3.5.0 is the prerequisite for this plugin.
- * @throws PlexusConfigurationException
- *
- * @since 3.5.1
- * @see <a href="https://issues.apache.org/jira/browse/MNG-6109">MNG-6109</a>
- * @see <a href="https://issues.apache.org/jira/browse/MPLUGIN-319">MPLUGIN-319</a>
- */
- void addMissingParameterSinceField(Parameter pd, PlexusConfiguration d) throws PlexusConfigurationException {
- String parameterSince = d.getChild("since").getValue();
- pd.setSince(parameterSince);
- }
-}
diff --git a/maven-plugin-plugin/src/main/resources/plugin-report.properties b/maven-plugin-plugin/src/main/resources/plugin-report.properties
deleted file mode 100644
index 7d9c45b5..00000000
--- a/maven-plugin-plugin/src/main/resources/plugin-report.properties
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-report.plugin.name=Plugin Documentation
-report.plugin.description=This report provides goals and parameters documentation of a plugin.
-report.plugin.title=Plugin Documentation
-
-report.plugin.goals.nogoal=No goals defined in this plugin.
-report.plugin.goals.intro=Goals available for this plugin:
-report.plugin.goals.column.goal=Goal
-report.plugin.goals.column.isMavenReport=Report?
-report.plugin.goals.column.description=Description
-report.plugin.goal.nodescription=No description.
-report.plugin.goal.deprecated=Deprecated.
-
-report.plugin.systemrequirements=System Requirements
-report.plugin.systemrequirements.intro=The following specifies the minimum requirements to run this Maven plugin:
-report.plugin.systemrequirements.nominimum= No minimum requirement.
-report.plugin.systemrequirements.maven=Maven
-report.plugin.systemrequirements.jdk=JDK
-report.plugin.systemrequirements.memory=Memory
-report.plugin.systemrequirements.diskspace=Disk Space
-
-report.plugin.systemrequirements.history=System Requirements History
-report.plugin.systemrequirements.history.intro=The following specifies the minimum requirements to run this Maven plugin for historical versions:
-report.plugin.systemrequirements.history.version=Plugin Version
-report.plugin.systemrequirements.history.maven=Maven
-report.plugin.systemrequirements.history.jdk=JDK
-
-report.plugin.usage=Usage
-report.plugin.usage.intro=You should specify the version in your project's plugin configuration:
-report.plugin.usage.pluginManagement=To define the plugin version in your parent POM
-report.plugin.usage.plugins=To use the plugin goals in your POM or parent POM
-report.plugin.usage.reporting=To use the report goals in your POM or parent POM
-report.plugin.configuration.end=For more information, see {"Guide to Configuring Plug-ins", https://maven.apache.org/guides/mini/guide-configuring-plugins.html}
-
-report.plugin.isReport=Yes
-report.plugin.isNotReport=No
diff --git a/maven-plugin-plugin/src/main/resources/plugin-report_de.properties b/maven-plugin-plugin/src/main/resources/plugin-report_de.properties
deleted file mode 100644
index e87e5c07..00000000
--- a/maven-plugin-plugin/src/main/resources/plugin-report_de.properties
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-report.plugin.name=Plugin-Dokumentation
-report.plugin.description=Dieser Bericht dokumentiert die Goals des Plugins und deren Parameter.
-report.plugin.title=Plugin-Dokumentation
-
-report.plugin.goals.nogoal=Keine Goals verf\u00FCgbar.
-report.plugin.goals.intro=Verf\u00FCgbare Goals dieses Plugins:
-report.plugin.goals.column.goal=Goal
-report.plugin.goals.column.isMavenReport=Bericht?
-report.plugin.goals.column.description=Beschreibung
-report.plugin.goal.nodescription=Keine Beschreibung.
-report.plugin.goal.deprecated=Missbilligt.
-
-report.plugin.systemrequirements=Systemvoraussetzungen
-report.plugin.systemrequirements.intro=Die folgende Tabelle listet die Mindestanforderungen zum Ausf\u00FChren dieses Plugins auf:
-report.plugin.systemrequirements.nominimum=Keine Mindestanforderung.
-report.plugin.systemrequirements.maven=Maven
-report.plugin.systemrequirements.jdk=JDK
-report.plugin.systemrequirements.memory=Arbeitsspeicher
-report.plugin.systemrequirements.diskspace=Festplatte
-
-report.plugin.systemrequirements.history=Historie der Systemvoraussetzungen
-report.plugin.systemrequirements.history.intro=In der folgenden Tabelle sind die Mindestanforderungen zum Ausf\u00FChren dieses Plug-ins f\u00FCr historische Versionen aufgef\u00FChrt:
-report.plugin.systemrequirements.history.version=Plugin Version
-report.plugin.systemrequirements.history.maven=Maven
-report.plugin.systemrequirements.history.jdk=JDK
-
-report.plugin.usage=Gebrauch
-report.plugin.usage.intro=Geben Sie die gew\u00FCnschte Version einfach in der Plugin-Konfiguration Ihres Projekts an:
-report.plugin.usage.pluginManagement=Zum Definieren der Plugin-Version in der Eltern-POM
-report.plugin.usage.plugins=Zum Verwenden der Plugin-Goals w\u00E4hrend des Build-Vorgangs eines Projekts
-report.plugin.usage.reporting=Zum Erzeugen der Berichte f\u00FCr die Projektdokumentation
-report.plugin.configuration.end=F\u00FCr weitergehende Informationen lesen Sie bitte den Artikel {"Guide to Configuring Plug-ins", https://maven.apache.org/guides/mini/guide-configuring-plugins.html}.
-
-report.plugin.isReport=Ja
-report.plugin.isNotReport=Nein
diff --git a/maven-plugin-plugin/src/main/resources/plugin-report_en.properties b/maven-plugin-plugin/src/main/resources/plugin-report_en.properties
deleted file mode 100644
index 96cf4075..00000000
--- a/maven-plugin-plugin/src/main/resources/plugin-report_en.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# NOTE:
-# This bundle is intentionally empty because English strings are provided by the base bundle via the parent chain. It
-# must be provided nevertheless such that a request for locale "en" will not errorneously pick up the bundle for the
-# JVM's default locale (which need not be "en"). See the method javadoc about
-# ResourceBundle.getBundle(String, Locale, ClassLoader)
-# for a full description of the lookup strategy.
diff --git a/maven-plugin-plugin/src/main/resources/plugin-report_fr.properties b/maven-plugin-plugin/src/main/resources/plugin-report_fr.properties
deleted file mode 100644
index 2ac7b3fb..00000000
--- a/maven-plugin-plugin/src/main/resources/plugin-report_fr.properties
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-report.plugin.name=Documentation du plugin
-report.plugin.description=Ce rapport fournit de la documentation sur les goals et les param\u00EAtres d'un plugin.
-report.plugin.title=Documentation du plugin
-
-report.plugin.goals.nogoal=Aucun goal disponible.
-report.plugin.goals.intro=Goals disponibles pour ce plugin :
-report.plugin.goals.column.goal=Goal
-report.plugin.goals.column.isMavenReport=Rapport?
-report.plugin.goals.column.description=Description
-report.plugin.goal.nodescription=Pas de description.
-report.plugin.goal.deprecated=Obsol\u00E8te.
-
-report.plugin.systemrequirements=Exigences Syst\u00E8mes
-report.plugin.systemrequirements.intro=Ce qui suit sp\u00E9cifie les exigences minimales pour ex\u00E9cuter ce plugin Maven :
-report.plugin.systemrequirements.nominimum= Aucune exigence minimale.
-report.plugin.systemrequirements.maven=Maven
-report.plugin.systemrequirements.jdk=JDK
-report.plugin.systemrequirements.memory=M\u00E9moire
-report.plugin.systemrequirements.diskspace=Espace Disque
-
-report.plugin.systemrequirements.history=Historique des Exigences Syst\u00E8mes
-report.plugin.systemrequirements.history.intro=Ce qui suit sp\u00E9cifie les exigences minimales pour ex\u00E9cuter ce plugin Maven pour les versions historiques:
-report.plugin.systemrequirements.history.version=Version du Plugin
-report.plugin.systemrequirements.history.maven=Maven
-report.plugin.systemrequirements.history.jdk=JDK
-
-report.plugin.usage=Utilisation
-report.plugin.usage.intro=Vous devez sp\u00E9cifier la version dans la configuration de votre projet :
-report.plugin.usage.pluginManagement=Pour d\u00E9finir la version du plugin dans le POM parent
-report.plugin.usage.plugins=Pour utiliser les goals du plugin dans votre POM ou POM parent
-report.plugin.usage.reporting=Pour utiliser les goals de rapports dans votre POM ou POM parent
-report.plugin.configuration.end=Pour plus d'informations, consultez {"Guide to Configuring Plug-ins", https://maven.apache.org/guides/mini/guide-configuring-plugins.html}
-
-report.plugin.isReport=Oui
-report.plugin.isNotReport=Non
diff --git a/maven-plugin-plugin/src/main/resources/plugin-report_sv.properties b/maven-plugin-plugin/src/main/resources/plugin-report_sv.properties
deleted file mode 100644
index 0e806e49..00000000
--- a/maven-plugin-plugin/src/main/resources/plugin-report_sv.properties
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-report.plugin.name=Plugindokumentation
-report.plugin.description=Denna rapport tillhandah\u00E5ller m\u00E5l- och parameterdokumentation f\u00F6r en plugin.
-report.plugin.title=Plugindokumentation
-
-report.plugin.goals.nogoal=Inga m\u00E5l tillg\u00E4ngliga \u00E4nnu.
-report.plugin.goals.intro=Tillg\u00E4ngliga m\u00E5l f\u00F6r denna plugin:
-report.plugin.goals.column.goal=M\u00E5l
-report.plugin.goals.column.isMavenReport=Rapport?
-report.plugin.goals.column.description=Beskrivning
-report.plugin.goal.nodescription=Ingen beskrivning.
-report.plugin.goal.deprecated=F\u00F6r\u00E5ldrat.
-
-report.plugin.systemrequirements=Systemkrav
-report.plugin.systemrequirements.intro=F\u00F6ljande minimikrav st\u00E4lls f\u00F6r att k\u00F6ra denna Maven plugin:
-report.plugin.systemrequirements.nominimum= Inga minimikrav.
-report.plugin.systemrequirements.maven=Maven
-report.plugin.systemrequirements.jdk=JDK
-report.plugin.systemrequirements.memory=Minne
-report.plugin.systemrequirements.diskspace=Diskutrymme
-
-report.plugin.systemrequirements.history=Systemkravshistorik
-report.plugin.systemrequirements.history.intro=F\u00F6ljande anger minimikraven f\u00F6r att k\u00F6ra detta Maven-plugin f\u00F6r historiska versioner:
-report.plugin.systemrequirements.history.version=Plugin Version
-report.plugin.systemrequirements.history.maven=Maven
-report.plugin.systemrequirements.history.jdk=JDK
-
-report.plugin.usage=Anv\u00E4ndning
-report.plugin.usage.intro=Du b\u00F6r specificera versionen i ditt projekts pluginkonfiguration:
-report.plugin.usage.pluginManagement=F\u00F6r att definiera pluginversion i din f\u00F6r\u00E4ldra-POM
-report.plugin.usage.plugins=F\u00F6r att anv\u00E4nda plugin-m\u00E5len i din POM eller f\u00F6r\u00E4ldra-POM
-report.plugin.usage.reporting=F\u00F6r att anv\u00E4nda rapport-m\u00E5len i din POM eller f\u00F6r\u00E4ldra-POM
-report.plugin.configuration.end=F\u00F6r mer information, l\u00E4s {"Guide to Configuring Plug-ins", https://maven.apache.org/guides/mini/guide-configuring-plugins.html} (p\u00E5 engelska).
-
-report.plugin.isReport=Ja
-report.plugin.isNotReport=Nej
diff --git a/maven-plugin-report-plugin/pom.xml b/maven-plugin-report-plugin/pom.xml
index 4a7d3fae..7e87d5dd 100644
--- a/maven-plugin-report-plugin/pom.xml
+++ b/maven-plugin-report-plugin/pom.xml
@@ -56,8 +56,6 @@
<dependency>
<groupId>org.apache.maven.reporting</groupId>
<artifactId>maven-reporting-api</artifactId>
- <version>${reportingApiVersion}</version>
- <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
@@ -88,6 +86,7 @@
<dependency>
<groupId>org.apache.maven.doxia</groupId>
<artifactId>doxia-sink-api</artifactId>
+ <version>1.11.1</version>
</dependency>
<!-- shared -->
@@ -108,6 +107,11 @@
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter</artifactId>
+ <scope>test</scope>
+ </dependency>
<!-- Depenency is listed here because it's used in ITs -->
<dependency>
<groupId>org.apache.maven.plugins</groupId>
diff --git a/maven-plugin-plugin/src/it/mplugin-187/invoker.properties b/maven-plugin-report-plugin/src/it/mplugin-187/invoker.properties
similarity index 94%
rename from maven-plugin-plugin/src/it/mplugin-187/invoker.properties
rename to maven-plugin-report-plugin/src/it/mplugin-187/invoker.properties
index a16bae84..3b86dfb4 100644
--- a/maven-plugin-plugin/src/it/mplugin-187/invoker.properties
+++ b/maven-plugin-report-plugin/src/it/mplugin-187/invoker.properties
@@ -5,9 +5,9 @@
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
-#
+#
# http://www.apache.org/licenses/LICENSE-2.0
-#
+#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -15,4 +15,4 @@
# specific language governing permissions and limitations
# under the License.
-invoker.goals = clean plugin:report
+invoker.goals = clean plugin-report:report
diff --git a/maven-plugin-plugin/src/it/mplugin-187/pom.xml b/maven-plugin-report-plugin/src/it/mplugin-187/pom.xml
similarity index 91%
rename from maven-plugin-plugin/src/it/mplugin-187/pom.xml
rename to maven-plugin-report-plugin/src/it/mplugin-187/pom.xml
index 541ee69a..b0b1de57 100644
--- a/maven-plugin-plugin/src/it/mplugin-187/pom.xml
+++ b/maven-plugin-report-plugin/src/it/mplugin-187/pom.xml
@@ -26,7 +26,7 @@ under the License.
<artifactId>mplugin-187</artifactId>
<version>1.0-SNAPSHOT</version>
- <description>Verify that plugin:report succeeds</description>
+ <description>Verify that plugin-report:report succeeds</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -36,10 +36,10 @@ under the License.
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-plugin-plugin</artifactId>
+ <artifactId>maven-plugin-report-plugin</artifactId>
<version>@project.version@</version>
</plugin>
</plugins>
</build>
-</project>
\ No newline at end of file
+</project>
diff --git a/maven-plugin-tools-generators/pom.xml b/maven-plugin-tools-generators/pom.xml
index 922784eb..b6338db4 100644
--- a/maven-plugin-tools-generators/pom.xml
+++ b/maven-plugin-tools-generators/pom.xml
@@ -47,7 +47,6 @@
<dependency>
<groupId>org.apache.maven.reporting</groupId>
<artifactId>maven-reporting-api</artifactId>
- <version>${reportingApiVersion}</version>
</dependency>
<!-- plexus -->
diff --git a/pom.xml b/pom.xml
index c5302380..a7432391 100644
--- a/pom.xml
+++ b/pom.xml
@@ -101,8 +101,6 @@
maven-plugin-tools-annotations/src/main/java/o/a/m/tools/plugins/extractor/annotations/JavaAnnotationsMojoDescriptorExtractor#CLASS_VERSION_TO_JAVA_STRING
needs to be updated as well -->
<asmVersion>9.5</asmVersion>
- <doxiaVersion>1.11.1</doxiaVersion>
- <doxia-sitetoolsVersion>1.11.1</doxia-sitetoolsVersion>
<plexusUtilsVersion>3.5.0</plexusUtilsVersion>
<reportingApiVersion>3.1.1</reportingApiVersion>
<reportingImplVersion>3.2.0</reportingImplVersion>
@@ -182,32 +180,11 @@
<artifactId>maven-settings</artifactId>
<version>${mavenVersion}</version>
</dependency>
- <!-- doxia -->
+ <!-- shared -->
<dependency>
- <groupId>org.apache.maven.doxia</groupId>
- <artifactId>doxia-sink-api</artifactId>
- <version>${doxiaVersion}</version>
- <exclusions>
- <exclusion>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-container-default</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.maven.doxia</groupId>
- <artifactId>doxia-site-renderer</artifactId>
- <version>${doxia-sitetoolsVersion}</version>
- <exclusions>
- <exclusion>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-container-default</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-component-api</artifactId>
- </exclusion>
- </exclusions>
+ <groupId>org.apache.maven.reporting</groupId>
+ <artifactId>maven-reporting-api</artifactId>
+ <version>${reportingApiVersion}</version>
</dependency>
<dependency>
<groupId>org.apache.maven.reporting</groupId>
[maven-plugin-tools] 04/08: [MPLUGIN-470] *-mojo.xml (in PluginXdocGenerator) is overwritten when multiple locales are defined
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
michaelo pushed a commit to branch fixes
in repository https://gitbox.apache.org/repos/asf/maven-plugin-tools.git
commit d8d3a2677dce8495d2ece04e1e5ca62e5e6dc896
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Tue May 9 23:12:43 2023 +0200
[MPLUGIN-470] *-mojo.xml (in PluginXdocGenerator) is overwritten when multiple locales are defined
---
maven-plugin-report-plugin/src/it/plugin-report/pom.xml | 2 +-
.../src/it/plugin-report/verify.groovy | 8 ++++++++
.../org/apache/maven/plugin/plugin/report/PluginReport.java | 12 +++++++++---
3 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/maven-plugin-report-plugin/src/it/plugin-report/pom.xml b/maven-plugin-report-plugin/src/it/plugin-report/pom.xml
index 864bb3de..a6559802 100644
--- a/maven-plugin-report-plugin/src/it/plugin-report/pom.xml
+++ b/maven-plugin-report-plugin/src/it/plugin-report/pom.xml
@@ -91,7 +91,7 @@ under the License.
<artifactId>maven-site-plugin</artifactId>
<version>@sitePluginVersion@</version>
<configuration>
- <locales>en</locales>
+ <locales>en,de,fr</locales>
</configuration>
</plugin>
</plugins>
diff --git a/maven-plugin-report-plugin/src/it/plugin-report/verify.groovy b/maven-plugin-report-plugin/src/it/plugin-report/verify.groovy
index f57200f2..2f24cb8a 100644
--- a/maven-plugin-report-plugin/src/it/plugin-report/verify.groovy
+++ b/maven-plugin-report-plugin/src/it/plugin-report/verify.groovy
@@ -28,3 +28,11 @@ assert !pluginInfo.text.contains('Disk Space')
// check JDK and Maven requirements
assert pluginInfo.text.contains('1.8')
assert pluginInfo.text.contains('3.2.5')
+
+assert new File( basedir, 'target/site/de/noop-mojo.html' ).isFile()
+assert new File( basedir, 'target/site/de/report-mojo.html' ).isFile()
+assert new File( basedir, 'target/site/de/plugin-info.html' ).isFile()
+
+assert new File( basedir, 'target/site/fr/noop-mojo.html' ).isFile()
+assert new File( basedir, 'target/site/fr/report-mojo.html' ).isFile()
+assert new File( basedir, 'target/site/fr/plugin-info.html' ).isFile()
diff --git a/maven-plugin-report-plugin/src/main/java/org/apache/maven/plugin/plugin/report/PluginReport.java b/maven-plugin-report-plugin/src/main/java/org/apache/maven/plugin/plugin/report/PluginReport.java
index b9dd4e11..3816b4c5 100644
--- a/maven-plugin-report-plugin/src/main/java/org/apache/maven/plugin/plugin/report/PluginReport.java
+++ b/maven-plugin-report-plugin/src/main/java/org/apache/maven/plugin/plugin/report/PluginReport.java
@@ -31,6 +31,7 @@ import java.util.Optional;
import java.util.ResourceBundle;
import org.apache.maven.doxia.sink.Sink;
+import org.apache.maven.doxia.tools.SiteTool;
import org.apache.maven.model.Plugin;
import org.apache.maven.model.Prerequisites;
import org.apache.maven.plugin.descriptor.MojoDescriptor;
@@ -76,8 +77,8 @@ public class PluginReport extends AbstractMavenReport {
*
* @since 3.7.0
*/
- @Parameter(defaultValue = "${project.build.directory}/generated-site/xdoc")
- private File outputDirectory;
+ @Parameter(defaultValue = "${project.build.directory}/generated-site")
+ private File generatedSiteDirectory;
/**
* Set this to "true" to skip generating the report.
@@ -222,7 +223,12 @@ public class PluginReport extends AbstractMavenReport {
private void generateMojosDocumentation(PluginDescriptor pluginDescriptor, Locale locale)
throws MavenReportException {
try {
- File outputDir = outputDirectory;
+ File outputDir;
+ if (!locale.equals(SiteTool.DEFAULT_LOCALE)) {
+ outputDir = new File(new File(generatedSiteDirectory, locale.toString()), "xdoc");
+ } else {
+ outputDir = new File(generatedSiteDirectory, "xdoc");
+ }
outputDir.mkdirs();
PluginXdocGenerator generator = new PluginXdocGenerator(
[maven-plugin-tools] 05/08: [MPLUGIN-471] Generated table by PluginXdocGenerator does not contain default attributes
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
michaelo pushed a commit to branch fixes
in repository https://gitbox.apache.org/repos/asf/maven-plugin-tools.git
commit 946934f0371fa2fba308aa9b3c2bf2f0376c5714
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Tue May 9 23:30:26 2023 +0200
[MPLUGIN-471] Generated table by PluginXdocGenerator does not contain default attributes
---
.../maven/tools/plugin/generator/PluginXdocGenerator.java | 10 +++-------
.../src/test/resources/expected-testGoal-mojo.xml | 4 ++--
2 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/PluginXdocGenerator.java b/maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/PluginXdocGenerator.java
index 9e9c693b..b13598d0 100644
--- a/maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/PluginXdocGenerator.java
+++ b/maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/PluginXdocGenerator.java
@@ -99,7 +99,7 @@ public class PluginXdocGenerator implements Generator {
/**
* @param project not null.
- * @param locale not null wanted locale.
+ * @param locale not null.
*/
public PluginXdocGenerator(
MavenProject project,
@@ -107,11 +107,7 @@ public class PluginXdocGenerator implements Generator {
File reportOutputDirectory,
boolean disableInternalJavadocLinkValidation) {
this.project = project;
- if (locale == null) {
- this.locale = Locale.ENGLISH;
- } else {
- this.locale = locale;
- }
+ this.locale = locale;
this.reportOutputDirectory = reportOutputDirectory;
this.disableInternalJavadocLinkValidation = disableInternalJavadocLinkValidation;
}
@@ -446,7 +442,6 @@ public class PluginXdocGenerator implements Generator {
w.startElement("div");
if (StringUtils.isNotEmpty(parameter.getDescription())) {
-
w.writeMarkup(getXhtmlWithValidatedLinks(parameter.getDescription(), context));
} else {
w.writeMarkup(getString("pluginxdoc.nodescription"));
@@ -631,6 +626,7 @@ public class PluginXdocGenerator implements Generator {
w.startElement("table");
w.addAttribute("border", "0");
+ w.addAttribute("class", "bodyTable");
w.startElement("tr");
w.startElement("th");
diff --git a/maven-plugin-tools-generators/src/test/resources/expected-testGoal-mojo.xml b/maven-plugin-tools-generators/src/test/resources/expected-testGoal-mojo.xml
index fcb20034..25c6c70b 100644
--- a/maven-plugin-tools-generators/src/test/resources/expected-testGoal-mojo.xml
+++ b/maven-plugin-tools-generators/src/test/resources/expected-testGoal-mojo.xml
@@ -47,7 +47,7 @@
</li>
</ul>
<subsection name="Required Parameters">
- <table border="0">
+ <table border="0" class="bodyTable">
<tr>
<th>Name</th>
<th>Type</th>
@@ -81,7 +81,7 @@
</table>
</subsection>
<subsection name="Optional Parameters">
- <table border="0">
+ <table border="0" class="bodyTable">
<tr>
<th>Name</th>
<th>Type</th>
[maven-plugin-tools] 06/08: Simplify code
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
michaelo pushed a commit to branch fixes
in repository https://gitbox.apache.org/repos/asf/maven-plugin-tools.git
commit 86827b1f5890e43d32b950941fe73bcfb3f7b44e
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Tue May 9 23:41:03 2023 +0200
Simplify code
---
.../org/apache/maven/tools/plugin/generator/PluginXdocGenerator.java | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/PluginXdocGenerator.java b/maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/PluginXdocGenerator.java
index b13598d0..5ff30d05 100644
--- a/maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/PluginXdocGenerator.java
+++ b/maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/PluginXdocGenerator.java
@@ -192,9 +192,7 @@ public class PluginXdocGenerator implements Generator {
w.writeMarkup(getString("pluginxdoc.mojodescriptor.fullname"));
w.endElement(); // p
w.startElement("p");
- w.writeMarkup(mojoDescriptor.getPluginDescriptor().getGroupId() + ":"
- + mojoDescriptor.getPluginDescriptor().getArtifactId() + ":"
- + mojoDescriptor.getPluginDescriptor().getVersion() + ":" + mojoDescriptor.getGoal());
+ w.writeMarkup(mojoDescriptor.getPluginDescriptor().getId() + ":" + mojoDescriptor.getGoal());
w.endElement(); // p
String context = "goal " + mojoDescriptor.getGoal();
[maven-plugin-tools] 02/08: [MPLUGIN-468] Upgrade plugins and components (in ITs)
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
michaelo pushed a commit to branch fixes
in repository https://gitbox.apache.org/repos/asf/maven-plugin-tools.git
commit 69391f92b1f0354c2a9ab05345b41c74606813db
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Tue May 9 22:38:39 2023 +0200
[MPLUGIN-468] Upgrade plugins and components (in ITs)
---
.../annotation-with-inheritance-from-deps/pom.xml | 6 +-
.../it/annotation-with-inheritance-reactor/pom.xml | 2 +-
.../src/it/annotation-with-inheritance/pom.xml | 6 +-
.../expected-help.txt | 4 +-
.../invoker.properties | 6 +-
.../help-basic-deprecated-annotation-only/pom.xml | 4 +-
.../verify.groovy | 2 +-
.../src/it/help-basic-jdk11/pom.xml | 2 +-
maven-plugin-plugin/src/it/help-basic/pom.xml | 2 +-
maven-plugin-plugin/src/it/help-package/pom.xml | 2 +-
.../src/it/java-basic-annotations-jdk8/pom.xml | 6 +-
.../it/java-basic-annotations-jdkcurrent/pom.xml | 6 +-
.../src/it/java-basic-annotations/pom.xml | 6 +-
maven-plugin-plugin/src/it/mplugin-223/pom.xml | 2 +-
.../src/it/mplugin-272_java8/pom.xml | 2 +-
.../src/it/mplugin-299_no-configuration/pom.xml | 2 +-
.../it/mplugin-305_defaultMojoDependencies/pom.xml | 2 +-
.../it/mplugin-305_emptyMojoDependencies/pom.xml | 2 +-
.../it/mplugin-305_singleMojoDependencies/pom.xml | 4 +-
.../plugins/plugin/it/CustomSurefireMojo.java | 97 +++++++++++++++++++---
.../verify.groovy | 2 +-
.../src/it/mplugin-324_javadoc/pom.xml | 4 +-
.../src/it/mplugin-363_help-reproducible/pom.xml | 4 +-
.../it/mplugin-370-maven-deps-scope-bad/pom.xml | 2 +-
.../it/mplugin-370-maven-deps-scope-good/pom.xml | 4 +-
.../pom.xml | 6 +-
.../pom.xml | 2 +-
maven-plugin-plugin/src/it/mplugin-390/pom.xml | 4 +-
maven-plugin-plugin/src/it/packaging-jar/pom.xml | 2 +-
maven-plugin-plugin/src/it/v4api/pom.xml | 2 +-
.../src/it/fix-maven-since-3.x/pom.xml | 2 +-
.../src/it/mplugin-191/pom.xml | 4 +-
.../src/it/mplugin-319_report-since/pom.xml | 2 +-
.../src/it/mplugin-394_report-encoding/pom.xml | 2 +-
.../src/it/plugin-info-jdk-default-version/pom.xml | 2 +-
.../src/it/plugin-info-jdk/pom.xml | 2 +-
.../src/it/plugin-report-annotations/pom.xml | 4 +-
.../it/plugin-report-requirements-history/pom.xml | 2 +-
.../it/plugin-report-with-javadoc-links/pom.xml | 8 +-
.../src/it/plugin-report/pom.xml | 4 +-
pom.xml | 12 +--
41 files changed, 159 insertions(+), 82 deletions(-)
diff --git a/maven-plugin-plugin/src/it/annotation-with-inheritance-from-deps/pom.xml b/maven-plugin-plugin/src/it/annotation-with-inheritance-from-deps/pom.xml
index e5836c05..c3d9fd3a 100644
--- a/maven-plugin-plugin/src/it/annotation-with-inheritance-from-deps/pom.xml
+++ b/maven-plugin-plugin/src/it/annotation-with-inheritance-from-deps/pom.xml
@@ -29,8 +29,8 @@ under the License.
<name>Maven Integration Test :: annotation-with-inheritance-from-deps</name>
<description>
- Test plugin-plugin, which tests maven-plugin-tools-api and
- maven-plugin-tools-java. This will generate a plugin descriptor from
+ Test plugin-plugin, which tests maven-plugin-tools-api and
+ maven-plugin-tools-java. This will generate a plugin descriptor from
java-based mojo sources, install the plugin, and then use it.
</description>
@@ -80,7 +80,7 @@ under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <version>2.4</version>
+ <version>@compilerPluginVersion@</version>
</plugin>
</plugins>
</pluginManagement>
diff --git a/maven-plugin-plugin/src/it/annotation-with-inheritance-reactor/pom.xml b/maven-plugin-plugin/src/it/annotation-with-inheritance-reactor/pom.xml
index d2f6b8bc..d47d1546 100644
--- a/maven-plugin-plugin/src/it/annotation-with-inheritance-reactor/pom.xml
+++ b/maven-plugin-plugin/src/it/annotation-with-inheritance-reactor/pom.xml
@@ -84,7 +84,7 @@ under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <version>2.4</version>
+ <version>@compilerPluginVersion@</version>
</plugin>
</plugins>
</pluginManagement>
diff --git a/maven-plugin-plugin/src/it/annotation-with-inheritance/pom.xml b/maven-plugin-plugin/src/it/annotation-with-inheritance/pom.xml
index b00ab7d5..e8a0f585 100644
--- a/maven-plugin-plugin/src/it/annotation-with-inheritance/pom.xml
+++ b/maven-plugin-plugin/src/it/annotation-with-inheritance/pom.xml
@@ -29,8 +29,8 @@ under the License.
<name>Maven Integration Test :: annotation-with-inheritance</name>
<description>
- Test plugin-plugin, which tests maven-plugin-tools-api and
- maven-plugin-tools-java. This will generate a plugin descriptor from
+ Test plugin-plugin, which tests maven-plugin-tools-api and
+ maven-plugin-tools-java. This will generate a plugin descriptor from
java-based mojo sources, install the plugin, and then use it.
</description>
@@ -76,7 +76,7 @@ under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <version>2.4</version>
+ <version>@compilerPluginVersion@</version>
</plugin>
</plugins>
</pluginManagement>
diff --git a/maven-plugin-plugin/src/it/help-basic-deprecated-annotation-only/expected-help.txt b/maven-plugin-plugin/src/it/help-basic-deprecated-annotation-only/expected-help.txt
index e7b0693d..cfb75851 100644
--- a/maven-plugin-plugin/src/it/help-basic-deprecated-annotation-only/expected-help.txt
+++ b/maven-plugin-plugin/src/it/help-basic-deprecated-annotation-only/expected-help.txt
@@ -1,7 +1,7 @@
-[INFO] help 1.0-SNAPSHOT
+[INFO] help-deprecated-annotation-only 1.0-SNAPSHOT
Tests generation and compilation of the help mojo.
-help:test
+help-deprecated-annotation-only:test
Deprecated. No reason given
MOJO-DESCRIPTION. Some "quotation" marks and backslashes '\\', some important
diff --git a/maven-plugin-plugin/src/it/help-basic-deprecated-annotation-only/invoker.properties b/maven-plugin-plugin/src/it/help-basic-deprecated-annotation-only/invoker.properties
index e7b0b4d6..8920e947 100644
--- a/maven-plugin-plugin/src/it/help-basic-deprecated-annotation-only/invoker.properties
+++ b/maven-plugin-plugin/src/it/help-basic-deprecated-annotation-only/invoker.properties
@@ -5,9 +5,9 @@
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
-#
+#
# http://www.apache.org/licenses/LICENSE-2.0
-#
+#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -16,4 +16,4 @@
# under the License.
invoker.goals.1 = clean install
-invoker.goals.2 = --log-file help.log org.apache.maven.its.plugin:help:1.0-SNAPSHOT:help
+invoker.goals.2 = --log-file help.log org.apache.maven.its.plugin:help-deprecated-annotation-only:1.0-SNAPSHOT:help
diff --git a/maven-plugin-plugin/src/it/help-basic-deprecated-annotation-only/pom.xml b/maven-plugin-plugin/src/it/help-basic-deprecated-annotation-only/pom.xml
index 97ae7060..cb3004a7 100644
--- a/maven-plugin-plugin/src/it/help-basic-deprecated-annotation-only/pom.xml
+++ b/maven-plugin-plugin/src/it/help-basic-deprecated-annotation-only/pom.xml
@@ -23,7 +23,7 @@ under the License.
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven.its.plugin</groupId>
- <artifactId>help</artifactId>
+ <artifactId>help-deprecated-annotation-only</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>maven-plugin</packaging>
@@ -56,7 +56,7 @@ under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <version>3.10.1</version>
+ <version>@compilerPluginVersion@</version>
</plugin>
</plugins>
</pluginManagement>
diff --git a/maven-plugin-plugin/src/it/help-basic-deprecated-annotation-only/verify.groovy b/maven-plugin-plugin/src/it/help-basic-deprecated-annotation-only/verify.groovy
index 219231bd..613385af 100644
--- a/maven-plugin-plugin/src/it/help-basic-deprecated-annotation-only/verify.groovy
+++ b/maven-plugin-plugin/src/it/help-basic-deprecated-annotation-only/verify.groovy
@@ -20,7 +20,7 @@
expected = new File( basedir, "expected-help.txt" ).text.trim().replace( "\r", "" )
log = new File( basedir, "help.log" ).text.replace( "\r", "" )
-log = log.substring( log.indexOf( "[INFO] help 1.0-SNAPSHOT" ) )
+log = log.substring( log.indexOf( "[INFO] help-deprecated-annotation-only 1.0-SNAPSHOT" ) )
log = log.substring( 0, log.indexOf( "[INFO]", 5 ) ).trim()
assert log == expected
diff --git a/maven-plugin-plugin/src/it/help-basic-jdk11/pom.xml b/maven-plugin-plugin/src/it/help-basic-jdk11/pom.xml
index 65c20966..a8f72562 100644
--- a/maven-plugin-plugin/src/it/help-basic-jdk11/pom.xml
+++ b/maven-plugin-plugin/src/it/help-basic-jdk11/pom.xml
@@ -56,7 +56,7 @@ under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <version>3.8.0</version>
+ <version>@compilerPluginVersion@</version>
<configuration>
<source>11</source>
<target>11</target>
diff --git a/maven-plugin-plugin/src/it/help-basic/pom.xml b/maven-plugin-plugin/src/it/help-basic/pom.xml
index 73e4ce49..016730e1 100644
--- a/maven-plugin-plugin/src/it/help-basic/pom.xml
+++ b/maven-plugin-plugin/src/it/help-basic/pom.xml
@@ -56,7 +56,7 @@ under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <version>2.4</version>
+ <version>@compilerPluginVersion@</version>
</plugin>
</plugins>
</pluginManagement>
diff --git a/maven-plugin-plugin/src/it/help-package/pom.xml b/maven-plugin-plugin/src/it/help-package/pom.xml
index 81f0376f..d5314d9d 100644
--- a/maven-plugin-plugin/src/it/help-package/pom.xml
+++ b/maven-plugin-plugin/src/it/help-package/pom.xml
@@ -50,7 +50,7 @@ under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <version>2.4</version>
+ <version>@compilerPluginVersion@</version>
</plugin>
</plugins>
</pluginManagement>
diff --git a/maven-plugin-plugin/src/it/java-basic-annotations-jdk8/pom.xml b/maven-plugin-plugin/src/it/java-basic-annotations-jdk8/pom.xml
index dda14a8a..eae3d7e0 100644
--- a/maven-plugin-plugin/src/it/java-basic-annotations-jdk8/pom.xml
+++ b/maven-plugin-plugin/src/it/java-basic-annotations-jdk8/pom.xml
@@ -29,8 +29,8 @@ under the License.
<name>Maven Integration Test :: basic-java-annotations-jdk8</name>
<description>
- Test plugin-plugin, which tests maven-plugin-tools-api and
- maven-plugin-tools-java. This will generate a plugin descriptor from
+ Test plugin-plugin, which tests maven-plugin-tools-api and
+ maven-plugin-tools-java. This will generate a plugin descriptor from
java-based mojo sources, install the plugin, and then use it.
</description>
@@ -69,7 +69,7 @@ under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <version>3.1</version>
+ <version>@compilerPluginVersion@</version>
<configuration>
<source>1.8</source><!-- avoid ${maven.compiler.source} since value is not as expected -->
<target>1.8</target><!-- avoid ${maven.compiler.target} since value is not as expected -->
diff --git a/maven-plugin-plugin/src/it/java-basic-annotations-jdkcurrent/pom.xml b/maven-plugin-plugin/src/it/java-basic-annotations-jdkcurrent/pom.xml
index ad2b9729..13db79f6 100644
--- a/maven-plugin-plugin/src/it/java-basic-annotations-jdkcurrent/pom.xml
+++ b/maven-plugin-plugin/src/it/java-basic-annotations-jdkcurrent/pom.xml
@@ -29,8 +29,8 @@ under the License.
<name>Maven Integration Test :: basic-java-annotations-jdk8</name>
<description>
- Test plugin-plugin, which tests maven-plugin-tools-api and
- maven-plugin-tools-java. This will generate a plugin descriptor from
+ Test plugin-plugin, which tests maven-plugin-tools-api and
+ maven-plugin-tools-java. This will generate a plugin descriptor from
java-based mojo sources, install the plugin, and then use it.
</description>
@@ -65,7 +65,7 @@ under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <version>3.8.0</version>
+ <version>@compilerPluginVersion@</version>
<configuration>
<release>${java.specification.version}</release>
</configuration>
diff --git a/maven-plugin-plugin/src/it/java-basic-annotations/pom.xml b/maven-plugin-plugin/src/it/java-basic-annotations/pom.xml
index 19ee2b15..a00a1381 100644
--- a/maven-plugin-plugin/src/it/java-basic-annotations/pom.xml
+++ b/maven-plugin-plugin/src/it/java-basic-annotations/pom.xml
@@ -29,8 +29,8 @@ under the License.
<name>Maven Integration Test :: basic-java-annotations</name>
<description>
- Test plugin-plugin, which tests maven-plugin-tools-api and
- maven-plugin-tools-java. This will generate a plugin descriptor from
+ Test plugin-plugin, which tests maven-plugin-tools-api and
+ maven-plugin-tools-java. This will generate a plugin descriptor from
java-based mojo sources, install the plugin, and then use it.
</description>
@@ -70,7 +70,7 @@ under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <version>2.4</version>
+ <version>@compilerPluginVersion@</version>
</plugin>
</plugins>
</pluginManagement>
diff --git a/maven-plugin-plugin/src/it/mplugin-223/pom.xml b/maven-plugin-plugin/src/it/mplugin-223/pom.xml
index 64e71c97..35c9bca1 100644
--- a/maven-plugin-plugin/src/it/mplugin-223/pom.xml
+++ b/maven-plugin-plugin/src/it/mplugin-223/pom.xml
@@ -53,7 +53,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <version>2.4</version>
+ <version>@compilerPluginVersion@</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
diff --git a/maven-plugin-plugin/src/it/mplugin-272_java8/pom.xml b/maven-plugin-plugin/src/it/mplugin-272_java8/pom.xml
index 94414e3b..236cb5df 100644
--- a/maven-plugin-plugin/src/it/mplugin-272_java8/pom.xml
+++ b/maven-plugin-plugin/src/it/mplugin-272_java8/pom.xml
@@ -48,7 +48,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <version>3.1</version>
+ <version>@compilerPluginVersion@</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
diff --git a/maven-plugin-plugin/src/it/mplugin-299_no-configuration/pom.xml b/maven-plugin-plugin/src/it/mplugin-299_no-configuration/pom.xml
index 671a83fc..1d92deaa 100644
--- a/maven-plugin-plugin/src/it/mplugin-299_no-configuration/pom.xml
+++ b/maven-plugin-plugin/src/it/mplugin-299_no-configuration/pom.xml
@@ -56,7 +56,7 @@ under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <version>2.4</version>
+ <version>@compilerPluginVersion@</version>
</plugin>
</plugins>
</pluginManagement>
diff --git a/maven-plugin-plugin/src/it/mplugin-305_defaultMojoDependencies/pom.xml b/maven-plugin-plugin/src/it/mplugin-305_defaultMojoDependencies/pom.xml
index 770a7849..13326430 100644
--- a/maven-plugin-plugin/src/it/mplugin-305_defaultMojoDependencies/pom.xml
+++ b/maven-plugin-plugin/src/it/mplugin-305_defaultMojoDependencies/pom.xml
@@ -57,7 +57,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <version>2.4</version>
+ <version>@compilerPluginVersion@</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
diff --git a/maven-plugin-plugin/src/it/mplugin-305_emptyMojoDependencies/pom.xml b/maven-plugin-plugin/src/it/mplugin-305_emptyMojoDependencies/pom.xml
index 03a3a3da..2e4bed7a 100644
--- a/maven-plugin-plugin/src/it/mplugin-305_emptyMojoDependencies/pom.xml
+++ b/maven-plugin-plugin/src/it/mplugin-305_emptyMojoDependencies/pom.xml
@@ -57,7 +57,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <version>2.4</version>
+ <version>@compilerPluginVersion@</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
diff --git a/maven-plugin-plugin/src/it/mplugin-305_singleMojoDependencies/pom.xml b/maven-plugin-plugin/src/it/mplugin-305_singleMojoDependencies/pom.xml
index 456e475a..b6c3a5fa 100644
--- a/maven-plugin-plugin/src/it/mplugin-305_singleMojoDependencies/pom.xml
+++ b/maven-plugin-plugin/src/it/mplugin-305_singleMojoDependencies/pom.xml
@@ -48,7 +48,7 @@
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>maven-surefire-common</artifactId>
- <version>2.19.1</version>
+ <version>3.1.0</version>
</dependency>
</dependencies>
@@ -57,7 +57,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <version>2.4</version>
+ <version>@compilerPluginVersion@</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
diff --git a/maven-plugin-plugin/src/it/mplugin-305_singleMojoDependencies/src/main/java/org/apache/maven/plugins/plugin/it/CustomSurefireMojo.java b/maven-plugin-plugin/src/it/mplugin-305_singleMojoDependencies/src/main/java/org/apache/maven/plugins/plugin/it/CustomSurefireMojo.java
index 54765bcf..37730040 100644
--- a/maven-plugin-plugin/src/it/mplugin-305_singleMojoDependencies/src/main/java/org/apache/maven/plugins/plugin/it/CustomSurefireMojo.java
+++ b/maven-plugin-plugin/src/it/mplugin-305_singleMojoDependencies/src/main/java/org/apache/maven/plugins/plugin/it/CustomSurefireMojo.java
@@ -23,7 +23,8 @@ import java.util.List;
import org.apache.maven.plugin.surefire.AbstractSurefireMojo;
import org.apache.maven.plugins.annotations.Mojo;
-import org.apache.maven.surefire.suite.RunResult;
+import org.apache.maven.surefire.api.suite.RunResult;
+import org.apache.maven.surefire.extensions.ForkNodeFactory;
@Mojo(name = "custom-surefire")
public class CustomSurefireMojo extends AbstractSurefireMojo {
@@ -40,7 +41,19 @@ public class CustomSurefireMojo extends AbstractSurefireMojo {
return null;
}
- public Boolean getFailIfNoSpecifiedTests() {
+ public String getEnableProcessChecker() {
+ return null;
+ }
+
+ public String getEncoding() {
+ return null;
+ }
+
+ public boolean getFailIfNoSpecifiedTests() {
+ return false;
+ }
+
+ public ForkNodeFactory getForkNode() {
return null;
}
@@ -48,6 +61,10 @@ public class CustomSurefireMojo extends AbstractSurefireMojo {
return 0;
}
+ public File getMainBuildPath() {
+ return null;
+ }
+
public double getParallelTestsTimeoutForcedInSeconds() {
return 0;
}
@@ -60,6 +77,10 @@ public class CustomSurefireMojo extends AbstractSurefireMojo {
return null;
}
+ public String getReportSchemaLocation() {
+ return null;
+ }
+
public File getReportsDirectory() {
return null;
}
@@ -108,16 +129,32 @@ public class CustomSurefireMojo extends AbstractSurefireMojo {
return false;
}
+ public boolean useModulePath() {
+ return false;
+ }
+
public void setBasedir(File arg0) {}
public void setClassesDirectory(File arg0) {}
public void setDebugForkedProcess(String arg0) {}
+ public void setEncoding(String arg0) {}
+
+ public void setExcludes(List<String> arg0) {}
+
+ public void setExcludeJUnit5Engines(String[] arg0) {}
+
public void setFailIfNoSpecifiedTests(boolean arg0) {}
+ public void setForkedProcessExitTimeoutInSeconds(int arg0) {}
+
public void setForkedProcessTimeoutInSeconds(int arg0) {}
+ public void setIncludeJUnit5Engines(String[] arg0) {}
+
+ public void setMainBuildPath(File arg0) {}
+
public void setParallelTestsTimeoutForcedInSeconds(double arg0) {}
public void setParallelTestsTimeoutInSeconds(double arg0) {}
@@ -128,12 +165,20 @@ public class CustomSurefireMojo extends AbstractSurefireMojo {
public void setReportsDirectory(File arg0) {}
+ public void setRunOrder(String arg0) {}
+
+ public void setRunOrderRandomSeed(Long arg0) {}
+
public void setSkip(boolean arg0) {}
public void setSkipExec(boolean arg0) {}
public void setSkipTests(boolean arg0) {}
+ public void setSuiteXmlFiles(File[] arg0) {}
+
+ public void setSystemPropertiesFile(File arg0) {}
+
public void setTest(String arg0) {}
public void setTestClassesDirectory(File arg0) {}
@@ -142,18 +187,47 @@ public class CustomSurefireMojo extends AbstractSurefireMojo {
public void setUseManifestOnlyJar(boolean arg0) {}
+ public void setUseModulePath(boolean arg0) {}
+
public void setUseSystemClassLoader(boolean arg0) {}
+ public void setIncludes(List<String> arg0) {}
+
@Override
protected String[] getDefaultIncludes() {
return null;
}
+ @Override
+ public String[] getExcludeJUnit5Engines() {
+ return null;
+ }
+
+ @Override
+ protected String[] getExcludedEnvironmentVariables() {
+ return null;
+ }
+
+ @Override
+ public List<String> getExcludes() {
+ return null;
+ }
+
@Override
public File getExcludesFile() {
return null;
}
+ @Override
+ public int getForkedProcessExitTimeoutInSeconds() {
+ return 0;
+ }
+
+ @Override
+ public String[] getIncludeJUnit5Engines() {
+ return null;
+ }
+
@Override
public List<String> getIncludes() {
return null;
@@ -179,11 +253,21 @@ public class CustomSurefireMojo extends AbstractSurefireMojo {
return null;
}
+ @Override
+ public Long getRunOrderRandomSeed() {
+ return null;
+ }
+
@Override
public File[] getSuiteXmlFiles() {
return null;
}
+ @Override
+ public File getSystemPropertiesFile() {
+ return null;
+ }
+
@Override
protected void handleSummary(RunResult arg0, Exception arg1) {}
@@ -197,15 +281,6 @@ public class CustomSurefireMojo extends AbstractSurefireMojo {
return false;
}
- @Override
- public void setIncludes(List<String> arg0) {}
-
- @Override
- public void setRunOrder(String arg0) {}
-
- @Override
- public void setSuiteXmlFiles(File[] arg0) {}
-
@Override
protected List<File> suiteXmlFiles() {
return null;
diff --git a/maven-plugin-plugin/src/it/mplugin-305_singleMojoDependencies/verify.groovy b/maven-plugin-plugin/src/it/mplugin-305_singleMojoDependencies/verify.groovy
index 5105ea1b..583a19f6 100644
--- a/maven-plugin-plugin/src/it/mplugin-305_singleMojoDependencies/verify.groovy
+++ b/maven-plugin-plugin/src/it/mplugin-305_singleMojoDependencies/verify.groovy
@@ -21,6 +21,6 @@ assert descriptorFile.isFile()
def pluginDescriptor = new XmlParser().parse( descriptorFile );
assert pluginDescriptor.mojos.mojo.size() == 1
-assert pluginDescriptor.mojos.mojo.parameters.parameter.size() == 50
+assert pluginDescriptor.mojos.mojo.parameters.parameter.size() == 51
return true;
diff --git a/maven-plugin-plugin/src/it/mplugin-324_javadoc/pom.xml b/maven-plugin-plugin/src/it/mplugin-324_javadoc/pom.xml
index 1b283edb..e356357f 100644
--- a/maven-plugin-plugin/src/it/mplugin-324_javadoc/pom.xml
+++ b/maven-plugin-plugin/src/it/mplugin-324_javadoc/pom.xml
@@ -56,12 +56,12 @@ under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <version>3.8.0</version>
+ <version>@compilerPluginVersion@</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
- <version>3.4.1</version>
+ <version>@javadocPluginVersion@</version>
<configuration>
<level>private</level>
</configuration>
diff --git a/maven-plugin-plugin/src/it/mplugin-363_help-reproducible/pom.xml b/maven-plugin-plugin/src/it/mplugin-363_help-reproducible/pom.xml
index 699119c5..3a154242 100644
--- a/maven-plugin-plugin/src/it/mplugin-363_help-reproducible/pom.xml
+++ b/maven-plugin-plugin/src/it/mplugin-363_help-reproducible/pom.xml
@@ -56,7 +56,7 @@ under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <version>2.4</version>
+ <version>@compilerPluginVersion@</version>
</plugin>
</plugins>
</pluginManagement>
@@ -81,7 +81,7 @@ under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
- <version>3.1.0</version>
+ <version>3.3.1</version>
<executions>
<execution>
<id>copy</id>
diff --git a/maven-plugin-plugin/src/it/mplugin-370-maven-deps-scope-bad/pom.xml b/maven-plugin-plugin/src/it/mplugin-370-maven-deps-scope-bad/pom.xml
index 7514a0b5..2798708a 100644
--- a/maven-plugin-plugin/src/it/mplugin-370-maven-deps-scope-bad/pom.xml
+++ b/maven-plugin-plugin/src/it/mplugin-370-maven-deps-scope-bad/pom.xml
@@ -58,7 +58,7 @@ under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <version>3.8.1</version>
+ <version>@compilerPluginVersion@</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
diff --git a/maven-plugin-plugin/src/it/mplugin-370-maven-deps-scope-good/pom.xml b/maven-plugin-plugin/src/it/mplugin-370-maven-deps-scope-good/pom.xml
index 68fa7c53..88b49f4a 100644
--- a/maven-plugin-plugin/src/it/mplugin-370-maven-deps-scope-good/pom.xml
+++ b/maven-plugin-plugin/src/it/mplugin-370-maven-deps-scope-good/pom.xml
@@ -41,7 +41,7 @@ under the License.
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-jxr</artifactId>
- <version>3.1.1</version>
+ <version>3.3.0</version>
<scope>compile</scope>
</dependency>
<dependency>
@@ -64,7 +64,7 @@ under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <version>3.8.1</version>
+ <version>@compilerPluginVersion@</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
diff --git a/maven-plugin-plugin/src/it/mplugin-372-annotation-with-inheritance-from-provided-deps/pom.xml b/maven-plugin-plugin/src/it/mplugin-372-annotation-with-inheritance-from-provided-deps/pom.xml
index 456b6f14..6d739ec7 100644
--- a/maven-plugin-plugin/src/it/mplugin-372-annotation-with-inheritance-from-provided-deps/pom.xml
+++ b/maven-plugin-plugin/src/it/mplugin-372-annotation-with-inheritance-from-provided-deps/pom.xml
@@ -29,8 +29,8 @@ under the License.
<name>Maven Integration Test :: annotation-with-inheritance-from-deps</name>
<description>
- Test plugin-plugin, which tests maven-plugin-tools-api and
- maven-plugin-tools-java. This will generate a plugin descriptor from
+ Test plugin-plugin, which tests maven-plugin-tools-api and
+ maven-plugin-tools-java. This will generate a plugin descriptor from
java-based mojo sources, install the plugin, and then use it.
</description>
@@ -79,7 +79,7 @@ under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <version>3.8.1</version>
+ <version>@compilerPluginVersion@</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
diff --git a/maven-plugin-plugin/src/it/mplugin-382-exclude-provided-dependency/pom.xml b/maven-plugin-plugin/src/it/mplugin-382-exclude-provided-dependency/pom.xml
index 7ac218e9..e40e1f03 100644
--- a/maven-plugin-plugin/src/it/mplugin-382-exclude-provided-dependency/pom.xml
+++ b/maven-plugin-plugin/src/it/mplugin-382-exclude-provided-dependency/pom.xml
@@ -73,7 +73,7 @@ under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <version>3.8.1</version>
+ <version>@compilerPluginVersion@</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
diff --git a/maven-plugin-plugin/src/it/mplugin-390/pom.xml b/maven-plugin-plugin/src/it/mplugin-390/pom.xml
index 75ed4247..0f7aa5bd 100644
--- a/maven-plugin-plugin/src/it/mplugin-390/pom.xml
+++ b/maven-plugin-plugin/src/it/mplugin-390/pom.xml
@@ -73,7 +73,7 @@ under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <version>3.8.1</version>
+ <version>@compilerPluginVersion@</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
@@ -86,7 +86,7 @@ under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
- <version>3.0.0</version>
+ <version>3.1.0</version>
<executions>
<execution>
<id>touch</id>
diff --git a/maven-plugin-plugin/src/it/packaging-jar/pom.xml b/maven-plugin-plugin/src/it/packaging-jar/pom.xml
index 268956ed..5b4b8c3f 100644
--- a/maven-plugin-plugin/src/it/packaging-jar/pom.xml
+++ b/maven-plugin-plugin/src/it/packaging-jar/pom.xml
@@ -58,7 +58,7 @@ under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <version>2.4</version>
+ <version>@compilerPluginVersion@</version>
</plugin>
</plugins>
</pluginManagement>
diff --git a/maven-plugin-plugin/src/it/v4api/pom.xml b/maven-plugin-plugin/src/it/v4api/pom.xml
index 010d599a..a763c68b 100644
--- a/maven-plugin-plugin/src/it/v4api/pom.xml
+++ b/maven-plugin-plugin/src/it/v4api/pom.xml
@@ -51,7 +51,7 @@ under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <version>3.1</version>
+ <version>@compilerPluginVersion@</version>
<configuration>
<source>1.8</source><!-- avoid ${maven.compiler.source} since value is not as expected -->
<target>1.8</target><!-- avoid ${maven.compiler.target} since value is not as expected -->
diff --git a/maven-plugin-report-plugin/src/it/fix-maven-since-3.x/pom.xml b/maven-plugin-report-plugin/src/it/fix-maven-since-3.x/pom.xml
index 47ea4d51..b3669660 100644
--- a/maven-plugin-report-plugin/src/it/fix-maven-since-3.x/pom.xml
+++ b/maven-plugin-report-plugin/src/it/fix-maven-since-3.x/pom.xml
@@ -81,7 +81,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-help-plugin</artifactId>
- <version>2.1.1</version>
+ <version>3.4.0</version>
</plugin>
</plugins>
</build>
diff --git a/maven-plugin-report-plugin/src/it/mplugin-191/pom.xml b/maven-plugin-report-plugin/src/it/mplugin-191/pom.xml
index 957ebff3..2dd1074c 100644
--- a/maven-plugin-report-plugin/src/it/mplugin-191/pom.xml
+++ b/maven-plugin-report-plugin/src/it/mplugin-191/pom.xml
@@ -53,7 +53,7 @@ under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <version>3.1</version>
+ <version>@compilerPluginVersion@</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -70,7 +70,7 @@ under the License.
</plugin>
</plugins>
</build>
-
+
<reporting>
<excludeDefaults>true</excludeDefaults>
<plugins>
diff --git a/maven-plugin-report-plugin/src/it/mplugin-319_report-since/pom.xml b/maven-plugin-report-plugin/src/it/mplugin-319_report-since/pom.xml
index f3e25ff7..9fece222 100644
--- a/maven-plugin-report-plugin/src/it/mplugin-319_report-since/pom.xml
+++ b/maven-plugin-report-plugin/src/it/mplugin-319_report-since/pom.xml
@@ -47,7 +47,7 @@ under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <version>2.3.2</version>
+ <version>@compilerPluginVersion@</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
diff --git a/maven-plugin-report-plugin/src/it/mplugin-394_report-encoding/pom.xml b/maven-plugin-report-plugin/src/it/mplugin-394_report-encoding/pom.xml
index 265c1191..2a813a35 100644
--- a/maven-plugin-report-plugin/src/it/mplugin-394_report-encoding/pom.xml
+++ b/maven-plugin-report-plugin/src/it/mplugin-394_report-encoding/pom.xml
@@ -59,7 +59,7 @@ under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <version>3.8.0</version>
+ <version>@compilerPluginVersion@</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
diff --git a/maven-plugin-report-plugin/src/it/plugin-info-jdk-default-version/pom.xml b/maven-plugin-report-plugin/src/it/plugin-info-jdk-default-version/pom.xml
index cf148d40..3dafd941 100644
--- a/maven-plugin-report-plugin/src/it/plugin-info-jdk-default-version/pom.xml
+++ b/maven-plugin-report-plugin/src/it/plugin-info-jdk-default-version/pom.xml
@@ -47,7 +47,7 @@ under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <version>2.3.2</version>
+ <version>@compilerPluginVersion@</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
diff --git a/maven-plugin-report-plugin/src/it/plugin-info-jdk/pom.xml b/maven-plugin-report-plugin/src/it/plugin-info-jdk/pom.xml
index 62ed497e..83c6d716 100644
--- a/maven-plugin-report-plugin/src/it/plugin-info-jdk/pom.xml
+++ b/maven-plugin-report-plugin/src/it/plugin-info-jdk/pom.xml
@@ -53,7 +53,7 @@ under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <version>2.3.2</version>
+ <version>@compilerPluginVersion@</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
diff --git a/maven-plugin-report-plugin/src/it/plugin-report-annotations/pom.xml b/maven-plugin-report-plugin/src/it/plugin-report-annotations/pom.xml
index d675726e..3d740f1e 100644
--- a/maven-plugin-report-plugin/src/it/plugin-report-annotations/pom.xml
+++ b/maven-plugin-report-plugin/src/it/plugin-report-annotations/pom.xml
@@ -27,7 +27,7 @@ under the License.
<version>1.0-SNAPSHOT</version>
<packaging>maven-plugin</packaging>
- <name>MPLUGIN-105</name>
+ <name>MPLUGIN-105</name>
<description>
Test basic site generation to guard against regression.
</description>
@@ -79,7 +79,7 @@ under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <version>2.4</version>
+ <version>@compilerPluginVersion@</version>
</plugin>
</plugins>
</pluginManagement>
diff --git a/maven-plugin-report-plugin/src/it/plugin-report-requirements-history/pom.xml b/maven-plugin-report-plugin/src/it/plugin-report-requirements-history/pom.xml
index 6716685c..0d77f338 100644
--- a/maven-plugin-report-plugin/src/it/plugin-report-requirements-history/pom.xml
+++ b/maven-plugin-report-plugin/src/it/plugin-report-requirements-history/pom.xml
@@ -58,7 +58,7 @@ under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <version>3.10.1</version>
+ <version>@compilerPluginVersion@</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
diff --git a/maven-plugin-report-plugin/src/it/plugin-report-with-javadoc-links/pom.xml b/maven-plugin-report-plugin/src/it/plugin-report-with-javadoc-links/pom.xml
index ca0b9d6a..cabb67cf 100644
--- a/maven-plugin-report-plugin/src/it/plugin-report-with-javadoc-links/pom.xml
+++ b/maven-plugin-report-plugin/src/it/plugin-report-with-javadoc-links/pom.xml
@@ -27,7 +27,7 @@ under the License.
<version>1.0-SNAPSHOT</version>
<packaging>maven-plugin</packaging>
- <name>MPLUGIN-417</name>
+ <name>MPLUGIN-417</name>
<description>
Test basic site generation containing javadoc links to internal and external javadoc sites.
</description>
@@ -70,7 +70,7 @@ under the License.
<artifactId>maven-reporting-impl</artifactId>
<version>@reportingImplVersion@</version>
</dependency>
-
+
</dependencies>
<build>
@@ -78,7 +78,7 @@ under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <version>3.5.1</version>
+ <version>@compilerPluginVersion@</version>
<configuration>
<!-- old maven-parent, so fix it like this. -->
<source>${maven.compiler.source}</source>
@@ -124,7 +124,7 @@ under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
- <version>3.4.1</version>
+ <version>@javadocPluginVersion@</version>
<configuration>
<excludePackageNames>org.internal</excludePackageNames>
</configuration>
diff --git a/maven-plugin-report-plugin/src/it/plugin-report/pom.xml b/maven-plugin-report-plugin/src/it/plugin-report/pom.xml
index dd95249a..864bb3de 100644
--- a/maven-plugin-report-plugin/src/it/plugin-report/pom.xml
+++ b/maven-plugin-report-plugin/src/it/plugin-report/pom.xml
@@ -27,7 +27,7 @@ under the License.
<version>1.0-SNAPSHOT</version>
<packaging>maven-plugin</packaging>
- <name>MPLUGIN-105</name>
+ <name>MPLUGIN-105</name>
<description>
Test basic site generation to guard against regression of MPLUGIN-105.
</description>
@@ -74,7 +74,7 @@ under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <version>3.5.1</version>
+ <version>@compilerPluginVersion@</version>
<configuration>
<!-- old maven-parent, so fix it like this. -->
<source>${maven.compiler.source}</source>
diff --git a/pom.xml b/pom.xml
index a7432391..a497cb3b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -97,13 +97,15 @@
<slf4jVersion>1.7.36</slf4jVersion>
<antVersion>1.10.13</antVersion>
<maven.site.path>plugin-tools-archives/plugin-tools-LATEST</maven.site.path>
- <!-- whenever the ASM version is updated also the
- maven-plugin-tools-annotations/src/main/java/o/a/m/tools/plugins/extractor/annotations/JavaAnnotationsMojoDescriptorExtractor#CLASS_VERSION_TO_JAVA_STRING
+ <!-- whenever the ASM version is updated also the
+ maven-plugin-tools-annotations/src/main/java/o/a/m/tools/plugins/extractor/annotations/JavaAnnotationsMojoDescriptorExtractor#CLASS_VERSION_TO_JAVA_STRING
needs to be updated as well -->
<asmVersion>9.5</asmVersion>
<plexusUtilsVersion>3.5.0</plexusUtilsVersion>
<reportingApiVersion>3.1.1</reportingApiVersion>
<reportingImplVersion>3.2.0</reportingImplVersion>
+ <compilerPluginVersion>3.11.0</compilerPluginVersion>
+ <javadocPluginVersion>3.5.0</javadocPluginVersion>
<project.build.outputTimestamp>2023-04-18T16:00:57Z</project.build.outputTimestamp>
</properties>
@@ -217,7 +219,7 @@
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-archiver</artifactId>
- <version>4.6.3</version>
+ <version>4.7.1</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
@@ -251,7 +253,7 @@
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
- <version>1.15.4</version>
+ <version>1.16.1</version>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
@@ -296,7 +298,7 @@
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
- <version>5.9.2</version>
+ <version>5.9.3</version>
<type>pom</type>
<scope>import</scope>
</dependency>
[maven-plugin-tools] 08/08: [MPLUGIN-472] Use Plexus I18N rathen than fiddling with resource bundles directly
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
michaelo pushed a commit to branch fixes
in repository https://gitbox.apache.org/repos/asf/maven-plugin-tools.git
commit 478b2f94a94d4cc2d971ba8f1ab5d19eabc04b7f
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Tue May 9 23:51:07 2023 +0200
[MPLUGIN-472] Use Plexus I18N rathen than fiddling with resource bundles
directly
---
maven-plugin-report-plugin/pom.xml | 12 ++
.../maven/plugin/plugin/report/PluginReport.java | 212 +++++++++++----------
2 files changed, 120 insertions(+), 104 deletions(-)
diff --git a/maven-plugin-report-plugin/pom.xml b/maven-plugin-report-plugin/pom.xml
index 7e87d5dd..d5425d28 100644
--- a/maven-plugin-report-plugin/pom.xml
+++ b/maven-plugin-report-plugin/pom.xml
@@ -100,6 +100,18 @@
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
</dependency>
+ <!-- Plexus -->
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-i18n</artifactId>
+ <version>1.0-beta-10</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-component-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
<!-- tests -->
<dependency>
diff --git a/maven-plugin-report-plugin/src/main/java/org/apache/maven/plugin/plugin/report/PluginReport.java b/maven-plugin-report-plugin/src/main/java/org/apache/maven/plugin/plugin/report/PluginReport.java
index 3816b4c5..525e22e9 100644
--- a/maven-plugin-report-plugin/src/main/java/org/apache/maven/plugin/plugin/report/PluginReport.java
+++ b/maven-plugin-report-plugin/src/main/java/org/apache/maven/plugin/plugin/report/PluginReport.java
@@ -23,13 +23,12 @@ import java.io.IOException;
import java.io.Reader;
import java.nio.file.Files;
import java.util.ArrayList;
-import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Optional;
-import java.util.ResourceBundle;
+import org.apache.maven.doxia.markup.Markup;
import org.apache.maven.doxia.sink.Sink;
import org.apache.maven.doxia.tools.SiteTool;
import org.apache.maven.model.Plugin;
@@ -56,6 +55,7 @@ import org.apache.maven.tools.plugin.generator.GeneratorUtils;
import org.apache.maven.tools.plugin.generator.PluginXdocGenerator;
import org.apache.maven.tools.plugin.util.PluginUtils;
import org.codehaus.plexus.configuration.PlexusConfigurationException;
+import org.codehaus.plexus.i18n.I18N;
import org.codehaus.plexus.util.StringUtils;
import org.codehaus.plexus.util.xml.XmlStreamReader;
import org.codehaus.plexus.util.xml.Xpp3Dom;
@@ -120,6 +120,12 @@ public class PluginReport extends AbstractMavenReport {
@Component
private RuntimeInformation rtInfo;
+ /**
+ * Internationalization component.
+ */
+ @Component
+ private I18N i18n;
+
/**
* Path to enhanced plugin descriptor to generate the report from (must contain some XHTML values)
*
@@ -175,7 +181,7 @@ public class PluginReport extends AbstractMavenReport {
// Write the overview
PluginOverviewRenderer r = new PluginOverviewRenderer(
- getProject(), requirementsHistories, getSink(), pluginDescriptor, locale, hasExtensionsToLoad);
+ getSink(), i18n, locale, getProject(), requirementsHistories, pluginDescriptor, hasExtensionsToLoad);
r.render();
}
@@ -189,20 +195,29 @@ public class PluginReport extends AbstractMavenReport {
}
}
+ /**
+ * @param locale The locale
+ * @param key The key to search for
+ * @return The text appropriate for the locale.
+ */
+ private String getI18nString(Locale locale, String key) {
+ return i18n.getString("plugin-report", locale, "report.plugin." + key);
+ }
+
/**
* {@inheritDoc}
*/
@Override
- public String getDescription(Locale locale) {
- return getBundle(locale).getString("report.plugin.description");
+ public String getName(Locale locale) {
+ return getI18nString(locale, "name");
}
/**
* {@inheritDoc}
*/
@Override
- public String getName(Locale locale) {
- return getBundle(locale).getString("report.plugin.name");
+ public String getDescription(Locale locale) {
+ return getI18nString(locale, "description");
}
/**
@@ -240,62 +255,65 @@ public class PluginReport extends AbstractMavenReport {
}
}
- /**
- * @param locale not null
- * @return the bundle for this report
- */
- protected static ResourceBundle getBundle(Locale locale) {
- return ResourceBundle.getBundle("plugin-report", locale, PluginReport.class.getClassLoader());
- }
-
/**
* Generates an overview page with the list of goals
* and a link to the goal's page.
*/
static class PluginOverviewRenderer extends AbstractMavenReportRenderer {
+ private final I18N i18n;
+
+ private final Locale locale;
+
private final MavenProject project;
private final List<RequirementsHistory> requirementsHistories;
private final PluginDescriptor pluginDescriptor;
- private final Locale locale;
-
private final boolean hasExtensionsToLoad;
/**
+ * @param sink not null
+ * @param i18n not null
+ * @param locale not null
* @param project not null
* @param requirementsHistories not null
- * @param sink not null
* @param pluginDescriptor not null
- * @param locale not null
*/
PluginOverviewRenderer(
+ Sink sink,
+ I18N i18n,
+ Locale locale,
MavenProject project,
List<RequirementsHistory> requirementsHistories,
- Sink sink,
PluginDescriptor pluginDescriptor,
- Locale locale,
boolean hasExtensionsToLoad) {
super(sink);
+ this.i18n = i18n;
+
+ this.locale = locale;
+
this.project = project;
this.requirementsHistories = requirementsHistories;
this.pluginDescriptor = pluginDescriptor;
- this.locale = locale;
-
this.hasExtensionsToLoad = hasExtensionsToLoad;
}
- /**
- * {@inheritDoc}
- */
@Override
public String getTitle() {
- return getBundle(locale).getString("report.plugin.title");
+ return getI18nString("title");
+ }
+
+ /**
+ * @param key The key.
+ * @return The translated string.
+ */
+ protected String getI18nString(String key) {
+ return i18n.getString("plugin-report", locale, "report.plugin." + key);
}
/**
@@ -307,17 +325,15 @@ public class PluginReport extends AbstractMavenReport {
if (!(pluginDescriptor.getMojos() != null
&& pluginDescriptor.getMojos().size() > 0)) {
- paragraph(getBundle(locale).getString("report.plugin.goals.nogoal"));
+ paragraph(getI18nString("goals.nogoal"));
endSection();
return;
}
- paragraph(getBundle(locale).getString("report.plugin.goals.intro"));
+ paragraph(getI18nString("goals.intro"));
boolean hasMavenReport = false;
- for (Iterator<MojoDescriptor> i = pluginDescriptor.getMojos().iterator(); i.hasNext(); ) {
- MojoDescriptor mojo = i.next();
-
+ for (MojoDescriptor mojo : pluginDescriptor.getMojos()) {
if (GeneratorUtils.isMavenReport(mojo.getImplementation(), project)) {
hasMavenReport = true;
}
@@ -325,9 +341,9 @@ public class PluginReport extends AbstractMavenReport {
startTable();
- String goalColumnName = getBundle(locale).getString("report.plugin.goals.column.goal");
- String isMavenReport = getBundle(locale).getString("report.plugin.goals.column.isMavenReport");
- String descriptionColumnName = getBundle(locale).getString("report.plugin.goals.column.description");
+ String goalColumnName = getI18nString("goals.column.goal");
+ String isMavenReport = getI18nString("goals.column.isMavenReport");
+ String descriptionColumnName = getI18nString("goals.column.description");
if (hasMavenReport) {
tableHeader(new String[] {goalColumnName, isMavenReport, descriptionColumnName});
} else {
@@ -348,25 +364,20 @@ public class PluginReport extends AbstractMavenReport {
String description;
if (StringUtils.isNotEmpty(mojo.getDeprecated())) {
- description = "<strong>" + getBundle(locale).getString("report.plugin.goal.deprecated")
- + "</strong> " + mojo.getDeprecated();
+ description = "<strong>" + getI18nString("goal.deprecated") + "</strong> " + mojo.getDeprecated();
} else if (StringUtils.isNotEmpty(mojo.getDescription())) {
description = mojo.getDescription();
} else {
- description = getBundle(locale).getString("report.plugin.goal.nodescription");
+ description = getI18nString("goal.nodescription");
}
sink.tableRow();
tableCell(createLinkPatternedText(goalName, goalDocumentationLink));
if (hasMavenReport) {
if (GeneratorUtils.isMavenReport(mojo.getImplementation(), project)) {
- sink.tableCell();
- sink.text(getBundle(locale).getString("report.plugin.isReport"));
- sink.tableCell_();
+ tableCell(getI18nString("isReport"));
} else {
- sink.tableCell();
- sink.text(getBundle(locale).getString("report.plugin.isNotReport"));
- sink.tableCell_();
+ tableCell(getI18nString("isNotReport"));
}
}
tableCell(description, true);
@@ -375,25 +386,22 @@ public class PluginReport extends AbstractMavenReport {
endTable();
- startSection(getBundle(locale).getString("report.plugin.systemrequirements"));
+ startSection(getI18nString("systemrequirements"));
- paragraph(getBundle(locale).getString("report.plugin.systemrequirements.intro"));
+ paragraph(getI18nString("systemrequirements.intro"));
startTable();
String maven = discoverMavenRequirement(project, pluginDescriptor);
sink.tableRow();
- tableCell(getBundle(locale).getString("report.plugin.systemrequirements.maven"));
- tableCell(
- (maven != null
- ? maven
- : getBundle(locale).getString("report.plugin.systemrequirements.nominimum")));
+ tableCell(getI18nString("systemrequirements.maven"));
+ tableCell((maven != null ? maven : getI18nString("systemrequirements.nominimum")));
sink.tableRow_();
String jdk = discoverJdkRequirement(project, pluginDescriptor);
sink.tableRow();
- tableCell(getBundle(locale).getString("report.plugin.systemrequirements.jdk"));
- tableCell((jdk != null ? jdk : getBundle(locale).getString("report.plugin.systemrequirements.nominimum")));
+ tableCell(getI18nString("systemrequirements.jdk"));
+ tableCell((jdk != null ? jdk : getI18nString("systemrequirements.nominimum")));
sink.tableRow_();
endTable();
@@ -412,14 +420,14 @@ public class PluginReport extends AbstractMavenReport {
return;
}
- startSection(getBundle(locale).getString("report.plugin.systemrequirements.history"));
- paragraph(getBundle(locale).getString("report.plugin.systemrequirements.history.intro"));
+ startSection(getI18nString("systemrequirements.history"));
+ paragraph(getI18nString("systemrequirements.history.intro"));
startTable();
tableHeader(new String[] {
- getBundle(locale).getString("report.plugin.systemrequirements.history.version"),
- getBundle(locale).getString("report.plugin.systemrequirements.history.maven"),
- getBundle(locale).getString("report.plugin.systemrequirements.history.jdk")
+ getI18nString("systemrequirements.history.version"),
+ getI18nString("systemrequirements.history.maven"),
+ getI18nString("systemrequirements.history.jdk")
});
requirementsHistories.forEach(requirementsHistory -> {
@@ -440,90 +448,86 @@ public class PluginReport extends AbstractMavenReport {
* @param hasMavenReport If the plugin has a report or not
*/
private void renderUsageSection(boolean hasMavenReport) {
- startSection(getBundle(locale).getString("report.plugin.usage"));
+ startSection(getI18nString("usage"));
// Configuration
- sink.paragraph();
- text(getBundle(locale).getString("report.plugin.usage.intro"));
- sink.paragraph_();
+ paragraph(getI18nString("usage.intro"));
StringBuilder sb = new StringBuilder();
- sb.append("<project>").append('\n');
- sb.append(" ...").append('\n');
- sb.append(" <build>").append('\n');
- sb.append(" <!-- " + getBundle(locale).getString("report.plugin.usage.pluginManagement") + " -->")
- .append('\n');
- sb.append(" <pluginManagement>").append('\n');
- sb.append(" <plugins>").append('\n');
- sb.append(" <plugin>").append('\n');
+ sb.append("<project>").append(Markup.EOL);
+ sb.append(" ...").append(Markup.EOL);
+ sb.append(" <build>").append(Markup.EOL);
+ sb.append(" <!-- " + getI18nString("usage.pluginManagement") + " -->")
+ .append(Markup.EOL);
+ sb.append(" <pluginManagement>").append(Markup.EOL);
+ sb.append(" <plugins>").append(Markup.EOL);
+ sb.append(" <plugin>").append(Markup.EOL);
sb.append(" <groupId>")
.append(pluginDescriptor.getGroupId())
.append("</groupId>")
- .append('\n');
+ .append(Markup.EOL);
sb.append(" <artifactId>")
.append(pluginDescriptor.getArtifactId())
.append("</artifactId>")
- .append('\n');
+ .append(Markup.EOL);
sb.append(" <version>")
.append(pluginDescriptor.getVersion())
.append("</version>")
- .append('\n');
+ .append(Markup.EOL);
if (hasExtensionsToLoad) {
- sb.append(" <extensions>true</extensions>").append('\n');
+ sb.append(" <extensions>true</extensions>").append(Markup.EOL);
}
- sb.append(" </plugin>").append('\n');
- sb.append(" ...").append('\n');
- sb.append(" </plugins>").append('\n');
- sb.append(" </pluginManagement>").append('\n');
- sb.append(" <!-- " + getBundle(locale).getString("report.plugin.usage.plugins") + " -->")
- .append('\n');
- sb.append(" <plugins>").append('\n');
- sb.append(" <plugin>").append('\n');
+ sb.append(" </plugin>").append(Markup.EOL);
+ sb.append(" ...").append(Markup.EOL);
+ sb.append(" </plugins>").append(Markup.EOL);
+ sb.append(" </pluginManagement>").append(Markup.EOL);
+ sb.append(" <!-- " + getI18nString("usage.plugins") + " -->").append(Markup.EOL);
+ sb.append(" <plugins>").append(Markup.EOL);
+ sb.append(" <plugin>").append(Markup.EOL);
sb.append(" <groupId>")
.append(pluginDescriptor.getGroupId())
.append("</groupId>")
- .append('\n');
+ .append(Markup.EOL);
sb.append(" <artifactId>")
.append(pluginDescriptor.getArtifactId())
.append("</artifactId>")
- .append('\n');
- sb.append(" </plugin>").append('\n');
- sb.append(" ...").append('\n');
- sb.append(" </plugins>").append('\n');
- sb.append(" </build>").append('\n');
+ .append(Markup.EOL);
+ sb.append(" </plugin>").append(Markup.EOL);
+ sb.append(" ...").append(Markup.EOL);
+ sb.append(" </plugins>").append(Markup.EOL);
+ sb.append(" </build>").append(Markup.EOL);
if (hasMavenReport) {
- sb.append(" ...").append('\n');
- sb.append(" <!-- " + getBundle(locale).getString("report.plugin.usage.reporting") + " -->")
- .append('\n');
- sb.append(" <reporting>").append('\n');
- sb.append(" <plugins>").append('\n');
- sb.append(" <plugin>").append('\n');
+ sb.append(" ...").append(Markup.EOL);
+ sb.append(" <!-- " + getI18nString("usage.reporting") + " -->").append(Markup.EOL);
+ sb.append(" <reporting>").append(Markup.EOL);
+ sb.append(" <plugins>").append(Markup.EOL);
+ sb.append(" <plugin>").append(Markup.EOL);
sb.append(" <groupId>")
.append(pluginDescriptor.getGroupId())
.append("</groupId>")
- .append('\n');
+ .append(Markup.EOL);
sb.append(" <artifactId>")
.append(pluginDescriptor.getArtifactId())
.append("</artifactId>")
- .append('\n');
+ .append(Markup.EOL);
sb.append(" <version>")
.append(pluginDescriptor.getVersion())
.append("</version>")
- .append('\n');
- sb.append(" </plugin>").append('\n');
- sb.append(" ...").append('\n');
- sb.append(" </plugins>").append('\n');
- sb.append(" </reporting>").append('\n');
+ .append(Markup.EOL);
+ sb.append(" </plugin>").append(Markup.EOL);
+ sb.append(" ...").append(Markup.EOL);
+ sb.append(" </plugins>").append(Markup.EOL);
+ sb.append(" </reporting>").append(Markup.EOL);
}
- sb.append(" ...").append('\n');
- sb.append("</project>").append('\n');
+ sb.append(" ...").append(Markup.EOL);
+ sb.append("</project>");
verbatimText(sb.toString());
sink.paragraph();
- linkPatternedText(getBundle(locale).getString("report.plugin.configuration.end"));
+ linkPatternedText(getI18nString("configuration.end"));
sink.paragraph_();
endSection();
[maven-plugin-tools] 03/08: [MPLUGIN-469] Omit empty line in generated help goal output if plugin description is empty
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
michaelo pushed a commit to branch fixes
in repository https://gitbox.apache.org/repos/asf/maven-plugin-tools.git
commit e173b16701a84edd4b19f8f9efd295f9a53bd048
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Tue May 9 22:51:51 2023 +0200
[MPLUGIN-469] Omit empty line in generated help goal output if plugin description is empty
---
.../expected-help.txt | 1 -
.../src/it/help-basic/expected-help.txt | 1 -
.../src/main/resources/help-class-source-v4.vm | 6 +++--
.../src/main/resources/help-class-source.vm | 30 ++++++++++++----------
4 files changed, 20 insertions(+), 18 deletions(-)
diff --git a/maven-plugin-plugin/src/it/help-basic-deprecated-annotation-only/expected-help.txt b/maven-plugin-plugin/src/it/help-basic-deprecated-annotation-only/expected-help.txt
index cfb75851..d05f112a 100644
--- a/maven-plugin-plugin/src/it/help-basic-deprecated-annotation-only/expected-help.txt
+++ b/maven-plugin-plugin/src/it/help-basic-deprecated-annotation-only/expected-help.txt
@@ -20,6 +20,5 @@ help-deprecated-annotation-only:test
Parameter description in javadoc.
undocumentedParam
-
Required: Yes
User property: test.undocumented
diff --git a/maven-plugin-plugin/src/it/help-basic/expected-help.txt b/maven-plugin-plugin/src/it/help-basic/expected-help.txt
index ccc37585..68d99c2b 100644
--- a/maven-plugin-plugin/src/it/help-basic/expected-help.txt
+++ b/maven-plugin-plugin/src/it/help-basic/expected-help.txt
@@ -20,6 +20,5 @@ help:test
This parameter is deprecated.
undocumentedParam
-
Required: Yes
User property: test.undocumented
diff --git a/maven-plugin-tools-generators/src/main/resources/help-class-source-v4.vm b/maven-plugin-tools-generators/src/main/resources/help-class-source-v4.vm
index 4b2ba508..0ac5b891 100644
--- a/maven-plugin-tools-generators/src/main/resources/help-class-source-v4.vm
+++ b/maven-plugin-tools-generators/src/main/resources/help-class-source-v4.vm
@@ -298,7 +298,9 @@ public class HelpMojo
append( sb, "Deprecated. " + deprecated.getTextContent(), 3 );
append( sb, "", 0 );
}
- append( sb, parameterDescription, 3 );
+ if ( isNotEmpty( parameterDescription ) ) {
+ append( sb, parameterDescription, 3 );
+ }
if ( "true".equals( getValue( parameter, "required" ) ) )
{
append( sb, "Required: Yes", 3 );
@@ -449,7 +451,7 @@ public class HelpMojo
}
return level;
}
-
+
private static String getPropertyFromExpression( String expression )
{
if ( expression != null && expression.startsWith( "${" ) && expression.endsWith( "}" )
diff --git a/maven-plugin-tools-generators/src/main/resources/help-class-source.vm b/maven-plugin-tools-generators/src/main/resources/help-class-source.vm
index 06cc56e7..6c6e4a4e 100644
--- a/maven-plugin-tools-generators/src/main/resources/help-class-source.vm
+++ b/maven-plugin-tools-generators/src/main/resources/help-class-source.vm
@@ -5,9 +5,9 @@
## to you under the Apache License, Version 2.0 (the
## "License"); you may not use this file except in compliance
## with the License. You may obtain a copy of the License at
-##
+##
## http://www.apache.org/licenses/LICENSE-2.0
-##
+##
## Unless required by applicable law or agreed to in writing,
## software distributed under the License is distributed on an
## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -43,7 +43,7 @@ import java.util.List;
* Display help information on ${artifactId}.<br>
* Call <code>mvn ${goalPrefix}:help -Ddetail=true -Dgoal=<goal-name></code> to display parameter details.
* @author maven-plugin-tools
-#if ( !$useAnnotations )
+#if ( !$useAnnotations )
* @goal help
* @requiresProject false
* @threadSafe
@@ -58,11 +58,11 @@ public class HelpMojo
/**
* If <code>true</code>, display all settable properties for each goal.
*
-#if ( !$useAnnotations )
+#if ( !$useAnnotations )
* @parameter property="detail" default-value="false"
#end
*/
-#if ( $useAnnotations )
+#if ( $useAnnotations )
@Parameter( property = "detail", defaultValue = "false" )
#end
private boolean detail;
@@ -70,23 +70,23 @@ public class HelpMojo
/**
* The name of the goal for which to show help. If unspecified, all goals will be displayed.
*
-#if ( !$useAnnotations )
+#if ( !$useAnnotations )
* @parameter property="goal"
#end
*/
-#if ( $useAnnotations )
+#if ( $useAnnotations )
@Parameter( property = "goal" )
-#end
+#end
private java.lang.String goal;
/**
* The maximum length of a display line, should be positive.
*
-#if ( !$useAnnotations )
+#if ( !$useAnnotations )
* @parameter property="lineLength" default-value="80"
#end
*/
-#if ( $useAnnotations )
+#if ( $useAnnotations )
@Parameter( property = "lineLength", defaultValue = "80" )
#end
private int lineLength;
@@ -94,11 +94,11 @@ public class HelpMojo
/**
* The number of spaces per indentation level, should be positive.
*
-#if ( !$useAnnotations )
+#if ( !$useAnnotations )
* @parameter property="indentSize" default-value="2"
#end
*/
-#if ( $useAnnotations )
+#if ( $useAnnotations )
@Parameter( property = "indentSize", defaultValue = "2" )
#end
private int indentSize;
@@ -327,7 +327,9 @@ public class HelpMojo
append( sb, "Deprecated. " + deprecated.getTextContent(), 3 );
append( sb, "", 0 );
}
- append( sb, parameterDescription, 3 );
+ if ( isNotEmpty( parameterDescription ) ) {
+ append( sb, parameterDescription, 3 );
+ }
if ( "true".equals( getValue( parameter, "required" ) ) )
{
append( sb, "Required: Yes", 3 );
@@ -478,7 +480,7 @@ public class HelpMojo
}
return level;
}
-
+
private static String getPropertyFromExpression( String expression )
{
if ( expression != null && expression.startsWith( "${" ) && expression.endsWith( "}" )