Skip to content

Commit

Permalink
Prepare for Doxia 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-o committed Mar 20, 2023
1 parent 5757c0d commit 2a507cc
Show file tree
Hide file tree
Showing 46 changed files with 235 additions and 369 deletions.
60 changes: 11 additions & 49 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ under the License.
</parent>

<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.4.3-SNAPSHOT</version>
<version>4.0.0-M1-SNAPSHOT</version>
<packaging>maven-plugin</packaging>

<name>Apache Maven Project Info Reports Plugin</name>
Expand Down Expand Up @@ -119,14 +119,14 @@ under the License.

<properties>
<javaVersion>8</javaVersion>
<doxiaVersion>1.11.1</doxiaVersion>
<doxia-sitetoolsVersion>1.11.1</doxia-sitetoolsVersion>
<doxiaVersion>2.0.0-M6</doxiaVersion>
<doxiaSitetoolsVersion>2.0.0-M6</doxiaSitetoolsVersion>
<mavenVersion>3.2.5</mavenVersion>
<scmVersion>1.13.0</scmVersion>
<aetherVersion>1.0.0.v20140518</aetherVersion>
<sitePluginVersion>3.12.1</sitePluginVersion>
<fluidoSkinVersion>1.11.1</fluidoSkinVersion>
<surefire.version>2.22.2</surefire.version>
<sitePluginVersion>4.0.0-M6</sitePluginVersion>
<fluidoSkinVersion>2.0.0-M3</fluidoSkinVersion>
<surefire.version>3.0.0</surefire.version>
<checkstyle.violation.ignore>ParameterNumber,MethodLength</checkstyle.violation.ignore>
<project.build.outputTimestamp>2023-01-06T21:01:13Z</project.build.outputTimestamp>
</properties>
Expand All @@ -135,12 +135,12 @@ under the License.
<dependency>
<groupId>org.apache.maven.reporting</groupId>
<artifactId>maven-reporting-api</artifactId>
<version>3.1.1</version>
<version>4.0.0-M5</version>
</dependency>
<dependency>
<groupId>org.apache.maven.reporting</groupId>
<artifactId>maven-reporting-impl</artifactId>
<version>3.2.0</version>
<version>4.0.0-M5</version>
<exclusions>
<exclusion>
<groupId>org.apache.maven</groupId>
Expand Down Expand Up @@ -326,56 +326,18 @@ under the License.
<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-core</artifactId>
<version>${doxiaVersion}</version>
<exclusions>
<exclusion>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-container-default</artifactId>
</exclusion>
</exclusions>
</dependency>

<!-- Doxia Sitetools -->
<dependency>
<groupId>org.apache.maven.doxia</groupId>
<artifactId>doxia-decoration-model</artifactId>
<version>${doxia-sitetoolsVersion}</version>
</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>
</dependency>
<dependency>
<groupId>org.apache.maven.doxia</groupId>
<artifactId>doxia-integration-tools</artifactId>
<version>${doxia-sitetoolsVersion}</version>
<exclusions>
<exclusion>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-container-default</artifactId>
</exclusion>
</exclusions>
<version>${doxiaSitetoolsVersion}</version>
</dependency>

<!-- Plexus -->
Expand All @@ -393,7 +355,7 @@ under the License.
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>3.4.2</version>
<version>3.5.1</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
Expand Down Expand Up @@ -465,7 +427,7 @@ under the License.
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-http-lightweight</artifactId>
<version>3.5.1</version>
<version>3.5.3</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
28 changes: 14 additions & 14 deletions src/it/dependencies-java-1.7-and-1.8/verify.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,24 @@
File dependencies = new File( basedir, 'target/site/dependencies.html' )
def mavenModel = '''\
<tr class="a">
<td align="left">maven-model-3.3.9.jar</td>
<td align="right">164 kB</td>
<td align="right">71</td>
<td align="right">54</td>
<td align="right">3</td>
<td align="center">1.7</td>
<td align="center">Yes</td></tr>
<td style="text-align: left;">maven-model-3.3.9.jar</td>
<td style="text-align: right;">164 kB</td>
<td style="text-align: right;">71</td>
<td style="text-align: right;">54</td>
<td style="text-align: right;">3</td>
<td style="text-align: center;">1.7</td>
<td style="text-align: center;">Yes</td></tr>
'''

def jacksonDataTypeJsr310 = '''\
<tr class="a">
<td align="left">jackson-datatype-jsr310-2.6.4.jar</td>
<td align="right">78.1 kB</td>
<td align="right">69</td>
<td align="right">51</td>
<td align="right">5</td>
<td align="center">1.8</td>
<td align="center">Yes</td></tr>
<td style="text-align: left;">jackson-datatype-jsr310-2.6.4.jar</td>
<td style="text-align: right;">78.1 kB</td>
<td style="text-align: right;">69</td>
<td style="text-align: right;">51</td>
<td style="text-align: right;">5</td>
<td style="text-align: center;">1.8</td>
<td style="text-align: center;">Yes</td></tr>
'''

assert dependencies.text.contains( mavenModel.replaceAll( "\n", System.getProperty( "line.separator" ) ) )
Expand Down
2 changes: 1 addition & 1 deletion src/it/full-pom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
<artifactId>maven-site-plugin</artifactId>
<version>@sitePluginVersion@</version>
<configuration>
<locales>en,cs,de,en,es,fr,gl,hu,it,ja,ko,lt,nl,no,pl,pt,pt_BR,ru,sk,sv,tr,zh_CN,zh_TW</locales>
<locales>default,en,cs,de,en,es,fr,gl,hu,it,ja,ko,lt,nl,no,pl,pt,pt_BR,ru,sk,sv,tr,zh_CN,zh_TW</locales>
</configuration>
</plugin>
</plugins>
Expand Down
2 changes: 1 addition & 1 deletion src/it/minimal-pom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<artifactId>maven-site-plugin</artifactId>
<version>@sitePluginVersion@</version>
<configuration>
<locales>en,cs,de,es,fr,hu,it,ja,ko,nl,no,pl,pt,pt_BR,sk,sv,tr,zh_CN,zh_TW</locales>
<locales>default,en,cs,de,es,fr,hu,it,ja,ko,nl,no,pl,pt,pt_BR,sk,sv,tr,zh_CN,zh_TW</locales>
</configuration>
</plugin>
</plugins>
Expand Down
5 changes: 1 addition & 4 deletions src/it/multi-module/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<parent>
<groupId>org.apache</groupId>
<artifactId>apache</artifactId>
<version>16</version>
<version>29</version>
</parent>

<groupId>org.apache.maven.plugins.project-info-reports.its</groupId>
Expand Down Expand Up @@ -79,9 +79,6 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>@sitePluginVersion@</version>
<configuration>
<locales>en</locales>
</configuration>
</plugin>
</plugins>
</build>
Expand Down
4 changes: 2 additions & 2 deletions src/it/multi-module/verify.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ File mainDependencies = new File( basedir, 'main/target/site/dependencies.html'

// Dependency File Details section should display dep-1.0-SNAPSHOT.jar packaged from previous build (package phase),
// not dep/target/classes from current build (site phase)
assert !mainDependencies.text.contains( '<td align="left">dep/target/classes</td>' )
assert mainDependencies.text.contains( '<td align="left">dep-1.0-SNAPSHOT.jar</td>' )
assert !mainDependencies.text.contains( '<td style="text-align: left;">dep/target/classes</td>' )
assert mainDependencies.text.contains( '<td style="text-align: left;">dep-1.0-SNAPSHOT.jar</td>' )
Original file line number Diff line number Diff line change
Expand Up @@ -105,41 +105,5 @@ protected void text( String text )
}
}

/* FIXME The next two methods need to be retained until Doxia and Maven Reporting Impl properly implement
* the difference of a (boxed) real verbatim text and (boxed) source code.
*/
/**
* {@inheritDoc}
*/
@Override
protected void verbatimText( String text )
{
sink.verbatim( null );

text( text );

sink.verbatim_();
}

/**
* {@inheritDoc}
*/
@Override
protected void verbatimLink( String text, String href )
{
if ( StringUtils.isEmpty( href ) )
{
verbatimText( text );
}
else
{
sink.verbatim( null );

link( href, text );

sink.verbatim_();
}
}

protected abstract String getI18Nsection();
}
Original file line number Diff line number Diff line change
Expand Up @@ -94,22 +94,17 @@ public abstract class AbstractProjectInfoReport
@Parameter( defaultValue = "${session}", readonly = true, required = true )
private MavenSession session;

@Parameter( defaultValue = "${project.remoteArtifactRepositories}", readonly = true, required = true )
protected List<ArtifactRepository> remoteRepositories;

/**
* Plugin repositories used for the project.
*
* @since 3.1.0
*/
@Parameter( property = "project.pluginArtifactRepositories" )
@Parameter( defaultValue = "${project.pluginArtifactRepositories}", readonly = true, required = true )
protected List<ArtifactRepository> pluginRepositories;

/**
* The reactor projects.
*
* @since 2.10
*/
@Parameter( defaultValue = "${reactorProjects}", required = true, readonly = true )
protected List<MavenProject> reactorProjects;

/**
* The current user system settings for use in Maven.
*
Expand Down Expand Up @@ -152,6 +147,12 @@ public abstract class AbstractProjectInfoReport
@Parameter
private List<LicenseMapping> licenseMappings;

/**
* The local repository.
*/
@Parameter( defaultValue = "${localRepository}", readonly = true, required = true )
protected ArtifactRepository localRepository;

// ----------------------------------------------------------------------
// Public methods
// ----------------------------------------------------------------------
Expand Down Expand Up @@ -226,11 +227,6 @@ protected MavenSession getSession()
return session;
}

/**
* Reactor projects
*
* @return List of projects
*/
protected List<MavenProject> getReactorProjects()
{
return reactorProjects;
Expand Down Expand Up @@ -329,6 +325,7 @@ public String getDescription( Locale locale )
return getI18nString( locale, "description" );
}

// TODO Review, especially Locale.getDefault()
private static class CustomI18N
implements I18N
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ public void executeReport( Locale locale )

RepositoryUtils repoUtils =
new RepositoryUtils( getLog(), projectBuilder, repositorySystem, resolver,
project.getRemoteArtifactRepositories(), project.getPluginArtifactRepositories(),
buildingRequest, repositoryMetadataManager );
remoteRepositories, pluginRepositories, buildingRequest,
repositoryMetadataManager );

DependencyNode dependencyNode = resolveProject();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ private void generateConvergence( Locale locale, Sink sink, DependencyAnalyzeRes
private void generateDependencyDetails( Locale locale, Sink sink, List<ReverseDependencyLink> depList )
{
sink.table();
sink.tableRows( null, false );
sink.tableRows();

Map<String, List<ReverseDependencyLink>> artifactMap = getSortedUniqueArtifactMap( depList );

Expand All @@ -315,7 +315,7 @@ private void generateDependencyDetails( Locale locale, Sink sink, List<ReverseDe
sink.tableCell();

sink.table();
sink.tableRows( null, false );
sink.tableRows();

for ( String version : artifactMap.keySet() )
{
Expand Down Expand Up @@ -523,7 +523,7 @@ private Map<String, List<ReverseDependencyLink>> getSortedUniqueArtifactMap( Lis
private void generateLegend( Locale locale, Sink sink )
{
sink.table();
sink.tableRows( null, false );
sink.tableRows();
sink.tableCaption();
sink.bold();
sink.text( getI18nString( locale, "legend" ) );
Expand Down Expand Up @@ -564,7 +564,7 @@ private void generateStats( Locale locale, Sink sink, DependencyAnalyzeResult re

// Create report
sink.table();
sink.tableRows( null, false );
sink.tableRows();
sink.tableCaption();
sink.bold();
sink.text( getI18nString( locale, "stats.caption" ) );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ public void executeReport( Locale locale )

RepositoryUtils repoUtils =
new RepositoryUtils( getLog(), projectBuilder, repositorySystem, resolver,
project.getRemoteArtifactRepositories(), project.getPluginArtifactRepositories(),
buildingRequest, repositoryMetadataManager );
remoteRepositories, pluginRepositories, buildingRequest,
repositoryMetadataManager );

DependencyManagementRenderer r =
new DependencyManagementRenderer( getSink(), locale, getI18N( locale ), getLog(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ private void renderTeamMember( Contributor member, Map<String, Boolean> headersM
}
else
{
tableCell( "<a name=\"" + id + "\"></a>" + id, true );
tableCell( "<a id=\"" + id + "\"></a>" + id, true );
}
}
}
Expand Down
Loading

0 comments on commit 2a507cc

Please sign in to comment.