Skip to content

Commit

Permalink
[MPIR-424] Upgrade Maven Reporting API to 3.1.1/Maven Reporting Impl …
Browse files Browse the repository at this point in the history
…to 3.2.0
  • Loading branch information
michael-o committed Aug 7, 2022
1 parent a91b480 commit 53561fb
Show file tree
Hide file tree
Showing 16 changed files with 37 additions and 46 deletions.
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ under the License.
<mavenVersion>3.2.5</mavenVersion>
<scmVersion>1.13.0</scmVersion>
<aetherVersion>1.0.0.v20140518</aetherVersion>
<sitePluginVersion>3.12.0</sitePluginVersion>
<sitePluginVersion>3.12.1</sitePluginVersion>
<fluidoSkinVersion>1.11.1</fluidoSkinVersion>
<surefire.version>2.22.2</surefire.version>
<checkstyle.violation.ignore>ParameterNumber,MethodLength</checkstyle.violation.ignore>
Expand All @@ -135,12 +135,12 @@ under the License.
<dependency>
<groupId>org.apache.maven.reporting</groupId>
<artifactId>maven-reporting-api</artifactId>
<version>3.1.0</version>
<version>3.1.1</version>
</dependency>
<dependency>
<groupId>org.apache.maven.reporting</groupId>
<artifactId>maven-reporting-impl</artifactId>
<version>3.1.0</version>
<version>3.2.0</version>
<exclusions>
<exclusion>
<groupId>org.apache.maven</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
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;
Expand Down Expand Up @@ -67,14 +66,6 @@ public abstract class AbstractProjectInfoReport
// Mojo components
// ----------------------------------------------------------------------

/**
* SiteTool component.
*
* @since 2.1
*/
@Component
protected SiteTool siteTool;

/**
* Artifact Resolver component.
*/
Expand Down Expand Up @@ -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.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public abstract class AbstractProjectInfoTestCase
extends AbstractMojoTestCase
{
private ArtifactStubFactory artifactStubFactory;

/**
* The default locale is English.
*/
Expand Down Expand Up @@ -77,7 +77,7 @@ protected void setUp()

artifactStubFactory = new DependencyArtifactStubFactory( getTestFile( "target" ), true, false );
artifactStubFactory.getWorkingDir().mkdirs();

// Set the default Locale
Locale.setDefault( DEFAULT_LOCALE );
}
Expand Down Expand Up @@ -180,7 +180,7 @@ protected AbstractProjectInfoReport createReportMojo( String goal, File pluginXm
{
AbstractProjectInfoReport mojo = (AbstractProjectInfoReport) lookupMojo( goal, pluginXmlFile );
assertNotNull( "Mojo found.", mojo );

LegacySupport legacySupport = lookup( LegacySupport.class );
legacySupport.setSession( newMavenSession( new MavenProjectStub() ) );
DefaultRepositorySystemSession repoSession =
Expand All @@ -199,11 +199,10 @@ protected File generateReport( AbstractProjectInfoReport mojo, File pluginXmlFil
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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ public void testReport()
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ public void testReport()
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ public void testReport()
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ public void testReport()
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ public void testReport()

// 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ public void testReport()
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ public void testReport()
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
Expand Down Expand Up @@ -98,7 +99,8 @@ public void testReportLinksOnly()
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ public void testReport()
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ public void testReport()
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ public void testReport()
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
Expand Down Expand Up @@ -139,7 +140,8 @@ public void testReportEclipseM2EPluginLifecycleMapping()
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ public void testReport()
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ public void testReport()
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ public void testReport()
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" ));
Expand Down

0 comments on commit 53561fb

Please sign in to comment.