This is an automated email from the ASF dual-hosted git repository. michaelo pushed a commit to branch holy-moly in repository https://gitbox.apache.org/repos/asf/maven-project-info-reports-plugin.git
commit 68921ba2d9b379ac51d7a3fd950f2cbcbd4df69d Author: Michael Osipov <micha...@apache.org> AuthorDate: Sat Jul 2 23:58:47 2022 +0200 Prepare for Doxia 2.0.0 --- pom.xml | 14 ++++++------- .../projectinfo/AbstractProjectInfoReport.java | 23 ---------------------- .../projectinfo/DependencyConvergenceReport.java | 8 ++++++++ .../renderer/DependenciesRenderer.java | 6 +++++- .../projectinfo/AbstractProjectInfoTestCase.java | 13 +++++++----- .../report/projectinfo/CiManagementReportTest.java | 3 ++- .../report/projectinfo/DependenciesReportTest.java | 3 ++- .../DependencyConvergenceReportTest.java | 3 ++- .../DependencyManagementReportTest.java | 3 ++- .../maven/report/projectinfo/IndexReportTest.java | 3 ++- .../projectinfo/IssueManagementReportTest.java | 3 ++- .../report/projectinfo/LicensesReportTest.java | 6 ++++-- .../report/projectinfo/MailingListsReportTest.java | 3 ++- .../report/projectinfo/ModulesReportTest.java | 6 ++++-- .../projectinfo/PluginManagementReportTest.java | 6 ++++-- .../maven/report/projectinfo/ScmReportTest.java | 6 ++++-- .../report/projectinfo/SummaryReportTest.java | 3 ++- .../maven/report/projectinfo/TeamReportTest.java | 6 ++++-- 18 files changed, 64 insertions(+), 54 deletions(-) diff --git a/pom.xml b/pom.xml index 0220143..e61c9e2 100644 --- a/pom.xml +++ b/pom.xml @@ -30,7 +30,7 @@ under the License. </parent> <artifactId>maven-project-info-reports-plugin</artifactId> - <version>3.4.1-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version> <packaging>maven-plugin</packaging> <name>Apache Maven Project Info Reports Plugin</name> @@ -119,28 +119,28 @@ under the License. <properties> <javaVersion>8</javaVersion> - <doxiaVersion>1.11.1</doxiaVersion> - <doxia-sitetoolsVersion>1.11.1</doxia-sitetoolsVersion> + <doxiaVersion>2.0.0-M4</doxiaVersion> + <doxia-sitetoolsVersion>2.0.0-M4-SNAPSHOT</doxia-sitetoolsVersion> <mavenVersion>3.2.5</mavenVersion> <scmVersion>1.13.0</scmVersion> <aetherVersion>1.0.0.v20140518</aetherVersion> - <sitePluginVersion>3.12.0</sitePluginVersion> + <sitePluginVersion>4.0.0-M3</sitePluginVersion> <fluidoSkinVersion>1.11.1</fluidoSkinVersion> <surefire.version>2.22.2</surefire.version> <checkstyle.violation.ignore>ParameterNumber,MethodLength</checkstyle.violation.ignore> - <project.build.outputTimestamp>2022-07-09T21:42:49Z</project.build.outputTimestamp> + <project.build.outputTimestamp>2022-08-06T14:49:27Z</project.build.outputTimestamp> </properties> <dependencies> <dependency> <groupId>org.apache.maven.reporting</groupId> <artifactId>maven-reporting-api</artifactId> - <version>3.1.0</version> + <version>4.0.0-M2</version> </dependency> <dependency> <groupId>org.apache.maven.reporting</groupId> <artifactId>maven-reporting-impl</artifactId> - <version>3.1.0</version> + <version>4.0.0-M2</version> <exclusions> <exclusion> <groupId>org.apache.maven</groupId> diff --git a/src/main/java/org/apache/maven/report/projectinfo/AbstractProjectInfoReport.java b/src/main/java/org/apache/maven/report/projectinfo/AbstractProjectInfoReport.java index dd3d591..4d6f9c9 100644 --- a/src/main/java/org/apache/maven/report/projectinfo/AbstractProjectInfoReport.java +++ b/src/main/java/org/apache/maven/report/projectinfo/AbstractProjectInfoReport.java @@ -34,7 +34,6 @@ import java.util.MissingResourceException; import java.util.ResourceBundle; import org.apache.maven.artifact.repository.ArtifactRepository; -import org.apache.maven.doxia.tools.SiteTool; import org.apache.maven.execution.MavenSession; import org.apache.maven.model.Plugin; import org.apache.maven.plugins.annotations.Component; @@ -67,14 +66,6 @@ public abstract class AbstractProjectInfoReport // Mojo components // ---------------------------------------------------------------------- - /** - * SiteTool component. - * - * @since 2.1 - */ - @Component - protected SiteTool siteTool; - /** * Artifact Resolver component. */ @@ -103,20 +94,6 @@ public abstract class AbstractProjectInfoReport @Parameter( defaultValue = "${session}", readonly = true, required = true ) private MavenSession session; - /** - * Local Repository. - */ - @Parameter( property = "localRepository", required = true, readonly = true ) - protected ArtifactRepository localRepository; - - /** - * Remote repositories used for the project. - * - * @since 2.1 - */ - @Parameter( property = "project.remoteArtifactRepositories" ) - protected List<ArtifactRepository> remoteRepositories; - /** * Plugin repositories used for the project. * diff --git a/src/main/java/org/apache/maven/report/projectinfo/DependencyConvergenceReport.java b/src/main/java/org/apache/maven/report/projectinfo/DependencyConvergenceReport.java index a04f8d6..14df342 100644 --- a/src/main/java/org/apache/maven/report/projectinfo/DependencyConvergenceReport.java +++ b/src/main/java/org/apache/maven/report/projectinfo/DependencyConvergenceReport.java @@ -300,6 +300,7 @@ public class DependencyConvergenceReport private void generateDependencyDetails( Locale locale, Sink sink, List<ReverseDependencyLink> depList ) { sink.table(); + sink.tableRows( null, false ); Map<String, List<ReverseDependencyLink>> artifactMap = getSortedUniqueArtifactMap( depList ); @@ -314,6 +315,7 @@ public class DependencyConvergenceReport sink.tableCell(); sink.table(); + sink.tableRows( null, false ); for ( String version : artifactMap.keySet() ) { @@ -328,11 +330,13 @@ public class DependencyConvergenceReport sink.tableRow_(); } + sink.tableRows_(); sink.table_(); sink.tableCell_(); sink.tableRow_(); + sink.tableRows_(); sink.table_(); } @@ -518,6 +522,7 @@ public class DependencyConvergenceReport private void generateLegend( Locale locale, Sink sink ) { sink.table(); + sink.tableRows( null, false ); sink.tableCaption(); sink.bold(); sink.text( getI18nString( locale, "legend" ) ); @@ -535,6 +540,7 @@ public class DependencyConvergenceReport sink.tableRow_(); + sink.tableRows_(); sink.table_(); } @@ -557,6 +563,7 @@ public class DependencyConvergenceReport // Create report sink.table(); + sink.tableRows( null, false ); sink.tableCaption(); sink.bold(); sink.text( getI18nString( locale, "stats.caption" ) ); @@ -665,6 +672,7 @@ public class DependencyConvergenceReport sink.tableCell_(); sink.tableRow_(); + sink.tableRows_(); sink.table_(); } diff --git a/src/main/java/org/apache/maven/report/projectinfo/dependencies/renderer/DependenciesRenderer.java b/src/main/java/org/apache/maven/report/projectinfo/dependencies/renderer/DependenciesRenderer.java index 43eb156..ffd9249 100644 --- a/src/main/java/org/apache/maven/report/projectinfo/dependencies/renderer/DependenciesRenderer.java +++ b/src/main/java/org/apache/maven/report/projectinfo/dependencies/renderer/DependenciesRenderer.java @@ -857,7 +857,7 @@ public class DependenciesRenderer String javascript = String.format( "<img id=\"%s\" src=\"%s\" alt=\"%s\"" + " onclick=\"toggleDependencyDetails( '%s', '%s' );\"" - + " style=\"cursor: pointer; vertical-align: text-bottom;\"></img>", + + " style=\"cursor: pointer; vertical-align: text-bottom;\" />", imgId, IMG_INFO_URL, getI18nString( "graph.icon.information" ), dependencyDetailId, imgId ); sink.rawText( javascript ); @@ -911,6 +911,7 @@ public class DependenciesRenderer List<License> licenses = artifactProject.getLicenses(); sink.table(); + sink.tableRows( null, false ); sink.tableRow(); sink.tableHeaderCell(); @@ -1007,6 +1008,7 @@ public class DependenciesRenderer sink.tableCell_(); sink.tableRow_(); + sink.tableRows_(); sink.table_(); } catch ( ProjectBuildingException e ) @@ -1026,6 +1028,7 @@ public class DependenciesRenderer else { sink.table(); + sink.tableRows( null, false ); sink.tableRow(); sink.tableHeaderCell(); @@ -1056,6 +1059,7 @@ public class DependenciesRenderer sink.tableCell_(); sink.tableRow_(); + sink.tableRows_(); sink.table_(); } diff --git a/src/test/java/org/apache/maven/report/projectinfo/AbstractProjectInfoTestCase.java b/src/test/java/org/apache/maven/report/projectinfo/AbstractProjectInfoTestCase.java index d445b70..fbd8a8b 100644 --- a/src/test/java/org/apache/maven/report/projectinfo/AbstractProjectInfoTestCase.java +++ b/src/test/java/org/apache/maven/report/projectinfo/AbstractProjectInfoTestCase.java @@ -38,6 +38,8 @@ import org.eclipse.aether.internal.impl.SimpleLocalRepositoryManagerFactory; import org.eclipse.aether.DefaultRepositorySystemSession; import org.eclipse.aether.repository.LocalRepository; +import com.meterware.httpunit.HttpUnitOptions; + /** * Abstract class to test reports generation with <a href="http://www.httpunit.org/">HTTPUnit</a> framework. * @@ -49,7 +51,7 @@ public abstract class AbstractProjectInfoTestCase extends AbstractMojoTestCase { private ArtifactStubFactory artifactStubFactory; - + /** * The default locale is English. */ @@ -72,12 +74,14 @@ public abstract class AbstractProjectInfoTestCase // required for mojo lookups to work super.setUp(); + HttpUnitOptions.setScriptingEnabled( false ); + i18n = getContainer().lookup( I18N.class ); setVariableValueToObject( i18n, "defaultBundleName", "project-info-reports" ); artifactStubFactory = new DependencyArtifactStubFactory( getTestFile( "target" ), true, false ); artifactStubFactory.getWorkingDir().mkdirs(); - + // Set the default Locale Locale.setDefault( DEFAULT_LOCALE ); } @@ -180,7 +184,7 @@ public abstract class AbstractProjectInfoTestCase { AbstractProjectInfoReport mojo = (AbstractProjectInfoReport) lookupMojo( goal, pluginXmlFile ); assertNotNull( "Mojo found.", mojo ); - + LegacySupport legacySupport = lookup( LegacySupport.class ); legacySupport.setSession( newMavenSession( new MavenProjectStub() ) ); DefaultRepositorySystemSession repoSession = @@ -199,11 +203,10 @@ public abstract class AbstractProjectInfoTestCase mojo.execute(); ProjectBuilder builder = lookup( ProjectBuilder.class ); - + ProjectBuildingRequest buildingRequest = new DefaultProjectBuildingRequest(); buildingRequest.setRepositorySession( lookup( LegacySupport.class ).getRepositorySession() ); - assertNotNull( "Local repository", mojo.localRepository ); testMavenProject = builder.build( pluginXmlFile, buildingRequest ).getProject(); File outputDir = mojo.getReportOutputDirectory(); diff --git a/src/test/java/org/apache/maven/report/projectinfo/CiManagementReportTest.java b/src/test/java/org/apache/maven/report/projectinfo/CiManagementReportTest.java index 7ba4c92..027c328 100644 --- a/src/test/java/org/apache/maven/report/projectinfo/CiManagementReportTest.java +++ b/src/test/java/org/apache/maven/report/projectinfo/CiManagementReportTest.java @@ -64,7 +64,8 @@ public class CiManagementReportTest assertTrue( response.getContentLength() > 0 ); // Test the Page title - String expectedTitle = getString( "report.ci-management.title" ); + String expectedTitle = prepareTitle( "ci mangement project info", + getString( "report.ci-management.title" ) ); assertEquals( expectedTitle, response.getTitle() ); // Test the texts diff --git a/src/test/java/org/apache/maven/report/projectinfo/DependenciesReportTest.java b/src/test/java/org/apache/maven/report/projectinfo/DependenciesReportTest.java index edb2350..9f2f0ad 100644 --- a/src/test/java/org/apache/maven/report/projectinfo/DependenciesReportTest.java +++ b/src/test/java/org/apache/maven/report/projectinfo/DependenciesReportTest.java @@ -64,7 +64,8 @@ public class DependenciesReportTest assertTrue( response.getContentLength() > 0 ); // Test the Page title - String expectedTitle = getString( "report.dependencies.title" ); + String expectedTitle = prepareTitle( "dependencies project info", + getString( "report.dependencies.title" ) ); assertEquals( expectedTitle, response.getTitle() ); // Test the tables diff --git a/src/test/java/org/apache/maven/report/projectinfo/DependencyConvergenceReportTest.java b/src/test/java/org/apache/maven/report/projectinfo/DependencyConvergenceReportTest.java index 4d9c0d4..91768f2 100644 --- a/src/test/java/org/apache/maven/report/projectinfo/DependencyConvergenceReportTest.java +++ b/src/test/java/org/apache/maven/report/projectinfo/DependencyConvergenceReportTest.java @@ -63,7 +63,8 @@ public class DependencyConvergenceReportTest assertTrue( response.getContentLength() > 0 ); // Test the Page title - String expectedTitle = getString( "report.dependency-convergence.reactor.title" ); + String expectedTitle = prepareTitle( "dependency convergence project info", + getString( "report.dependency-convergence.reactor.title" ) ); assertEquals( expectedTitle, response.getTitle() ); // Test the texts diff --git a/src/test/java/org/apache/maven/report/projectinfo/DependencyManagementReportTest.java b/src/test/java/org/apache/maven/report/projectinfo/DependencyManagementReportTest.java index 8870f88..143cb2d 100644 --- a/src/test/java/org/apache/maven/report/projectinfo/DependencyManagementReportTest.java +++ b/src/test/java/org/apache/maven/report/projectinfo/DependencyManagementReportTest.java @@ -64,7 +64,8 @@ public class DependencyManagementReportTest assertTrue( response.getContentLength() > 0 ); // Test the Page title - String expectedTitle = getString( "report.dependency-management.title" ); + String expectedTitle = prepareTitle( "dependency management project info", + getString( "report.dependency-management.title" ) ); assertEquals( expectedTitle, response.getTitle() ); // Test the tables diff --git a/src/test/java/org/apache/maven/report/projectinfo/IndexReportTest.java b/src/test/java/org/apache/maven/report/projectinfo/IndexReportTest.java index d202be8..ccd6e37 100644 --- a/src/test/java/org/apache/maven/report/projectinfo/IndexReportTest.java +++ b/src/test/java/org/apache/maven/report/projectinfo/IndexReportTest.java @@ -64,7 +64,8 @@ public class IndexReportTest // Test the Page title // Index does not have a 'name' but 'title' only - String expectedTitle = getString( "report.index.title" ); + String expectedTitle = prepareTitle( "index project info", + getString( "report.index.title" ) ); assertEquals( expectedTitle, response.getTitle() ); // Test the texts diff --git a/src/test/java/org/apache/maven/report/projectinfo/IssueManagementReportTest.java b/src/test/java/org/apache/maven/report/projectinfo/IssueManagementReportTest.java index 3d61cf5..0f235bf 100644 --- a/src/test/java/org/apache/maven/report/projectinfo/IssueManagementReportTest.java +++ b/src/test/java/org/apache/maven/report/projectinfo/IssueManagementReportTest.java @@ -64,7 +64,8 @@ public class IssueManagementReportTest assertTrue( response.getContentLength() > 0 ); // Test the Page title - String expectedTitle = getString( "report.issue-management.title" ); + String expectedTitle = prepareTitle( "issue management project info", + getString( "report.issue-management.title" ) ); assertEquals( expectedTitle, response.getTitle() ); // Test the links diff --git a/src/test/java/org/apache/maven/report/projectinfo/LicensesReportTest.java b/src/test/java/org/apache/maven/report/projectinfo/LicensesReportTest.java index 6facb28..95fdf52 100644 --- a/src/test/java/org/apache/maven/report/projectinfo/LicensesReportTest.java +++ b/src/test/java/org/apache/maven/report/projectinfo/LicensesReportTest.java @@ -64,7 +64,8 @@ public class LicensesReportTest assertTrue( response.getContentLength() > 0 ); // Test the Page title - String expectedTitle = getString( "report.licenses.title" ); + String expectedTitle = prepareTitle( "licenses project info", + getString( "report.licenses.title" ) ); assertEquals( expectedTitle, response.getTitle() ); // Test the texts @@ -98,7 +99,8 @@ public class LicensesReportTest assertTrue( response.getContentLength() > 0 ); // Test the Page title - String expectedTitle = getString( "report.licenses.title" ); + String expectedTitle = prepareTitle( "licenses project info", + getString( "report.licenses.title" ) ); assertEquals( expectedTitle, response.getTitle() ); // Test the texts diff --git a/src/test/java/org/apache/maven/report/projectinfo/MailingListsReportTest.java b/src/test/java/org/apache/maven/report/projectinfo/MailingListsReportTest.java index aba655b..2a96e15 100644 --- a/src/test/java/org/apache/maven/report/projectinfo/MailingListsReportTest.java +++ b/src/test/java/org/apache/maven/report/projectinfo/MailingListsReportTest.java @@ -65,7 +65,8 @@ public class MailingListsReportTest assertTrue( response.getContentLength() > 0 ); // Test the Page title - String expectedTitle = getString( "report.mailing-lists.title" ); + String expectedTitle = prepareTitle( "mailing lists project info", + getString( "report.mailing-lists.title" ) ); assertEquals( expectedTitle, response.getTitle() ); // Test the texts diff --git a/src/test/java/org/apache/maven/report/projectinfo/ModulesReportTest.java b/src/test/java/org/apache/maven/report/projectinfo/ModulesReportTest.java index ceba692..a90106c 100644 --- a/src/test/java/org/apache/maven/report/projectinfo/ModulesReportTest.java +++ b/src/test/java/org/apache/maven/report/projectinfo/ModulesReportTest.java @@ -81,12 +81,14 @@ public class ModulesReportTest assertTrue( response.getContentLength() > 0 ); // Test the Page title - String expectedTitle = getString( "report.modules.title" ); + String expectedTitle = prepareTitle( "modules project info", + getString( "report.modules.title" ) ); assertEquals( expectedTitle, response.getTitle() ); // Test the texts TextBlock[] textBlocks = response.getTextBlocks(); - assertEquals( 2, textBlocks.length ); + // Last one is footer noise + assertEquals( 2, textBlocks.length - 1 ); assertEquals( getString( "report.modules.title" ), textBlocks[0].getText() ); assertEquals( getString( "report.modules.intro" ), textBlocks[1].getText() ); diff --git a/src/test/java/org/apache/maven/report/projectinfo/PluginManagementReportTest.java b/src/test/java/org/apache/maven/report/projectinfo/PluginManagementReportTest.java index 362b8bb..68cd90e 100644 --- a/src/test/java/org/apache/maven/report/projectinfo/PluginManagementReportTest.java +++ b/src/test/java/org/apache/maven/report/projectinfo/PluginManagementReportTest.java @@ -101,7 +101,8 @@ public class PluginManagementReportTest assertTrue( response.getContentLength() > 0 ); // Test the Page title - String expectedTitle = getString( "report.plugin-management.title" ); + String expectedTitle = prepareTitle( "plugin management project info", + getString( "report.plugin-management.title" ) ); assertEquals( expectedTitle, response.getTitle() ); // Test the tables @@ -139,7 +140,8 @@ public class PluginManagementReportTest assertTrue( response.getContentLength() > 0 ); // Test the Page title - String expectedTitle = getString( "report.plugin-management.title" ); + String expectedTitle = prepareTitle( "plugin management project info", + getString( "report.plugin-management.title" ) ); assertEquals( expectedTitle, response.getTitle() ); // Test the tables diff --git a/src/test/java/org/apache/maven/report/projectinfo/ScmReportTest.java b/src/test/java/org/apache/maven/report/projectinfo/ScmReportTest.java index 170d027..49504ec 100644 --- a/src/test/java/org/apache/maven/report/projectinfo/ScmReportTest.java +++ b/src/test/java/org/apache/maven/report/projectinfo/ScmReportTest.java @@ -66,12 +66,14 @@ public class ScmReportTest assertTrue( response.getContentLength() > 0 ); // Test the Page title - String expectedTitle = getString( "report.scm.title" ); + String expectedTitle = prepareTitle( "scm project info", + getString( "report.scm.title" ) ); assertEquals( expectedTitle, response.getTitle() ); // Test the texts TextBlock[] textBlocks = response.getTextBlocks(); - assertEquals( 6, textBlocks.length ); + // Last one is footer noise + assertEquals( 6, textBlocks.length - 1 ); assertEquals( getString( "report.scm.overview.title" ), textBlocks[0].getText() ); assertEquals( getString( "report.scm.general.intro" ), textBlocks[1].getText() ); assertEquals( getString( "report.scm.webaccess.title" ), textBlocks[2].getText() ); diff --git a/src/test/java/org/apache/maven/report/projectinfo/SummaryReportTest.java b/src/test/java/org/apache/maven/report/projectinfo/SummaryReportTest.java index 36e51ff..a716488 100644 --- a/src/test/java/org/apache/maven/report/projectinfo/SummaryReportTest.java +++ b/src/test/java/org/apache/maven/report/projectinfo/SummaryReportTest.java @@ -63,7 +63,8 @@ public class SummaryReportTest assertTrue( response.getContentLength() > 0 ); // Test the Page title - String expectedTitle = getString( "report.summary.title" ); + String expectedTitle = prepareTitle( "summary project info", + getString( "report.summary.title" ) ); assertEquals( expectedTitle, response.getTitle() ); // Test the texts diff --git a/src/test/java/org/apache/maven/report/projectinfo/TeamReportTest.java b/src/test/java/org/apache/maven/report/projectinfo/TeamReportTest.java index 21bb1a5..e45272e 100644 --- a/src/test/java/org/apache/maven/report/projectinfo/TeamReportTest.java +++ b/src/test/java/org/apache/maven/report/projectinfo/TeamReportTest.java @@ -70,14 +70,16 @@ public class TeamReportTest assertTrue( response.getContentLength() > 0 ); // Test the Page title - String expectedTitle = getString( "report.team.title" ); + String expectedTitle = prepareTitle( "team project info", + getString( "report.team.title" ) ); assertEquals( expectedTitle, response.getTitle() ); assertTrue( response.getText().contains( "gravatar" )); // Test the texts TextBlock[] textBlocks = response.getTextBlocks(); - assertEquals( 7, textBlocks.length ); + // Last one is footer noise + assertEquals( 7, textBlocks.length - 1 ); assertEquals( getString( "report.team.intro.title" ), textBlocks[0].getText() ); assertEquals( getString( "report.team.intro.description1" ), textBlocks[1].getText() ); assertEquals( getString( "report.team.intro.description2" ), textBlocks[2].getText() );