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 Feb 11, 2023
1 parent d6a6c9c commit 60126b1
Show file tree
Hide file tree
Showing 40 changed files with 198 additions and 311 deletions.
58 changes: 10 additions & 48 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-M5</doxiaVersion>
<doxiaSitetoolsVersion>2.0.0-M5</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-M5</sitePluginVersion>
<fluidoSkinVersion>2.0.0-M2</fluidoSkinVersion>
<surefire.version>3.0.0-M8</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-M4</version>
</dependency>
<dependency>
<groupId>org.apache.maven.reporting</groupId>
<artifactId>maven-reporting-impl</artifactId>
<version>3.2.0</version>
<version>4.0.0-M4</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.0</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
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>28</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 @@ -102,14 +102,6 @@ public abstract class AbstractProjectInfoReport
@Parameter( property = "project.pluginArtifactRepositories" )
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 @@ -226,11 +218,6 @@ protected MavenSession getSession()
return session;
}

/**
* Reactor projects
*
* @return List of projects
*/
protected List<MavenProject> getReactorProjects()
{
return reactorProjects;
Expand Down Expand Up @@ -329,6 +316,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 @@ -43,7 +43,6 @@
import org.apache.maven.doxia.sink.Sink;
import org.apache.maven.doxia.sink.SinkEventAttributes;
import org.apache.maven.doxia.sink.impl.SinkEventAttributeSet;
import org.apache.maven.doxia.util.HtmlTools;
import org.apache.maven.model.License;
import org.apache.maven.plugin.logging.Log;
import org.apache.maven.project.MavenProject;
Expand Down Expand Up @@ -96,11 +95,6 @@ public class DependenciesRenderer
/** Used to format file length values */
private final DecimalFormat fileLengthDecimalFormat;

/**
* @since 2.1.1
*/
private int section;

/** Counter for unique IDs that is consistent across generations. */
private int idCounter = 0;

Expand Down Expand Up @@ -236,124 +230,6 @@ public void renderBody()
}
}

// ----------------------------------------------------------------------
// Protected methods
// ----------------------------------------------------------------------

/** {@inheritDoc} */
// workaround for MPIR-140
// TODO Remove me when MSHARED-390 has been resolved
@Override
protected void startSection( String name )
{
startSection( name, name );
}

/**
* Start section with a name and a specific anchor.
*
* @param anchor not null
* @param name not null
*/
// TODO Remove me when MSHARED-390 has been resolved
protected void startSection( String anchor, String name )
{
section = section + 1;

super.sink.anchor( HtmlTools.encodeId( anchor ) );
super.sink.anchor_();

switch ( section )
{
case 1:
sink.section1();
sink.sectionTitle1();
break;
case 2:
sink.section2();
sink.sectionTitle2();
break;
case 3:
sink.section3();
sink.sectionTitle3();
break;
case 4:
sink.section4();
sink.sectionTitle4();
break;
case 5:
sink.section5();
sink.sectionTitle5();
break;

default:
// TODO: warning - just don't start a section
break;
}

text( name );

switch ( section )
{
case 1:
sink.sectionTitle1_();
break;
case 2:
sink.sectionTitle2_();
break;
case 3:
sink.sectionTitle3_();
break;
case 4:
sink.sectionTitle4_();
break;
case 5:
sink.sectionTitle5_();
break;

default:
// TODO: warning - just don't start a section
break;
}
}

/** {@inheritDoc} */
// workaround for MPIR-140
// TODO Remove me when MSHARED-390 has been resolved
@Override
protected void endSection()
{
switch ( section )
{
case 1:
sink.section1_();
break;
case 2:
sink.section2_();
break;
case 3:
sink.section3_();
break;
case 4:
sink.section4_();
break;
case 5:
sink.section5_();
break;

default:
// TODO: warning - just don't start a section
break;
}

section = section - 1;

if ( section < 0 )
{
throw new IllegalStateException( "Too many closing sections" );
}
}

// ----------------------------------------------------------------------
// Private methods
// ----------------------------------------------------------------------
Expand Down Expand Up @@ -742,7 +618,7 @@ private void renderDependenciesForScope( String scope, List<Artifact> artifacts,
String anchorByScope =
( isTransitive ? getI18nString( "transitive.title" ) + "_" + scope : getI18nString( "title" ) + "_"
+ scope );
startSection( anchorByScope, scope );
startSection( scope, anchorByScope );

paragraph( getI18nString( "intro." + scope ) );

Expand Down
Loading

0 comments on commit 60126b1

Please sign in to comment.