This is an automated email from the ASF dual-hosted git repository. michaelo pushed a commit to branch doxia-2.0.0-ga in repository https://gitbox.apache.org/repos/asf/maven-surefire.git
commit 620b983ffdaa9e258c6a355a476777cfe6b88c0d Author: Michael Osipov <micha...@apache.org> AuthorDate: Sun Oct 20 20:07:44 2024 +0200 [SUREFIRE-2281] Upgrade to Doxia 2.0.0 GA Stack This closes #794 --- maven-surefire-report-plugin/pom.xml | 4 +- .../surefire/report/AbstractSurefireReport.java | 44 +--------------------- 2 files changed, 3 insertions(+), 45 deletions(-) diff --git a/maven-surefire-report-plugin/pom.xml b/maven-surefire-report-plugin/pom.xml index d709b6e5c..f5aacb080 100644 --- a/maven-surefire-report-plugin/pom.xml +++ b/maven-surefire-report-plugin/pom.xml @@ -46,7 +46,7 @@ </prerequisites> <properties> - <doxiaVersion>2.0.0-M12</doxiaVersion> + <doxiaVersion>2.0.0</doxiaVersion> </properties> <dependencies> @@ -114,7 +114,7 @@ <dependency> <groupId>org.apache.maven.reporting</groupId> <artifactId>maven-reporting-impl</artifactId> - <version>4.0.0-M15</version> + <version>4.0.0</version> </dependency> <dependency> <groupId>org.codehaus.plexus</groupId> diff --git a/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/AbstractSurefireReport.java b/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/AbstractSurefireReport.java index 7025da05a..da3cf1b1c 100644 --- a/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/AbstractSurefireReport.java +++ b/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/AbstractSurefireReport.java @@ -25,22 +25,18 @@ import java.net.URL; import java.net.URLClassLoader; import java.text.MessageFormat; import java.util.ArrayList; -import java.util.Collections; import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.MissingResourceException; import java.util.ResourceBundle; -import org.apache.maven.model.ReportPlugin; -import org.apache.maven.model.Reporting; import org.apache.maven.plugin.surefire.log.api.ConsoleLogger; import org.apache.maven.plugins.annotations.Component; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.project.MavenProject; import org.apache.maven.reporting.AbstractMavenReport; import org.apache.maven.settings.Settings; -import org.apache.maven.shared.utils.PathTool; import org.codehaus.plexus.i18n.I18N; import org.codehaus.plexus.interpolation.EnvarBasedValueSource; import org.codehaus.plexus.interpolation.InterpolationException; @@ -154,7 +150,7 @@ public abstract class AbstractSurefireReport extends AbstractMavenReport { locale, getConsoleLogger(), getReportsDirectories(), - constructXrefTestLocation(), + linkXRef ? constructXrefLocation(xrefTestLocation, true) : null, showSuccess); r.render(); } @@ -256,44 +252,6 @@ public abstract class AbstractSurefireReport extends AbstractMavenReport { return result; } - private String constructXrefTestLocation() { - String location = null; - if (linkXRef) { - File xrefTestLocation = getXrefTestLocation(); - - String relativePath = PathTool.getRelativePath( - getReportOutputDirectory().getAbsolutePath(), xrefTestLocation.getAbsolutePath()); - if (relativePath == null || relativePath.isEmpty()) { - relativePath = "."; - } - relativePath = relativePath + "/" + xrefTestLocation.getName(); - if (xrefTestLocation.exists()) { - // XRef was already generated by manual execution of a lifecycle binding - location = relativePath; - } else { - // Not yet generated - check if the report is on its way - Reporting reporting = project.getModel().getReporting(); - List<ReportPlugin> reportPlugins = - reporting != null ? reporting.getPlugins() : Collections.<ReportPlugin>emptyList(); - for (ReportPlugin plugin : reportPlugins) { - String artifactId = plugin.getArtifactId(); - if ("maven-jxr-plugin".equals(artifactId)) { - location = relativePath; - } - } - } - - if (location == null) { - getConsoleLogger().warning("Unable to locate Test Source XRef to link to - DISABLED"); - } - } - return location; - } - - private File getXrefTestLocation() { - return xrefTestLocation != null ? xrefTestLocation : new File(getReportOutputDirectory(), "xref-test"); - } - /** * @param locale The locale * @param key The key to search for