You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 59 Next »

Site plugin with maven 3.x

Due to MNG-4162, all reporting logic has been removed from trunk.
So a branch of the site plugin has been created https://svn.apache.org/repos/asf/maven/plugins/branches/maven-site-plugin-3.x/ in order to have a site plugin working with maven 3.x.
Using previous versions of maven-site-plugin with Maven 3.x won't generate any report from any report plugin: only hand-written Doxia documents (apt, xdoc, ...) will be rendered.

Plugins Compatibility Matrix

Plugins Maintained by the Apache Maven Community

Tests have been made on the reporting profile of the maven parent pom which enables some reports.
Some of those plugins will need releases to work with maven 3.x:

Plugin

Version

Status

Comments

maven-javadoc-plugin

2.6.1

(tick)

some its failed MJAVADOC-181: need more investiguation

maven-project-info-reports-plugin

2.1.2

(error) (dependencies report)

need a release due to a use of plexusContainer.getLoggerManager() which has been removed see MPIR-174

surefire-report

2.4.3

(tick)

 

jxr

2.1

(tick)

 

maven-changelog-plugin

2.1

(tick)

 

maven-changes-plugin

2.1

(tick)

 

maven-checkstyle-plugin

2.5

(tick)

see MCHECKSTYLE-123

maven-plugin-plugin

2.5.1

(tick)

 

maven-pmd-plugin

2.4

(tick)

 

Plugins Maintained by the Mojo Community

Plugin

Version

Status

Comments

cobertura-maven-plugin

2.3

(tick)

 

emma-maven-plugin

1.0-alpha-2

(tick)

 

findbugs-maven-plugin

2.3.1

(question)

 

Known issues

What needs to be released

artifact

version

status

maven-shared-jar

1.1

(tick)

maven-reporting-impl

2.1

(tick)

maven-reporting-api

3.0

(tick)

maven-project-info-reports-plugin

2.2

(error)

maven-site-plugin

3.0-beta-1 (from 3.x branch)

(error)

Configuration format.

The current reporting section of the pom have to be moved in a new site plugin configuration.
The proposal is to have a configuration as much similar as possible with the current one.
The model builder will transform it on the fly, displaying a warning concerning this change. (as of Maven 3.0-alpha-6, on the fly transformation seems ok, but without warning)

Old configuration

  <reporting>
    <excludeDefaults>true</excludeDefaults>
    <outputDirectory></outputDirectory>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <version><at:var at:name="projectInfoReportsPluginVersion" /></version>
        <configuration>
          <dependencyDetailsEnabled>false</dependencyDetailsEnabled>
          <dependencyLocationsEnabled>false</dependencyLocationsEnabled>
          <filters>
            <filter>+hello.*</filter>
            <filter>+byebye.*</filter>
          </filters>
        </configuration>
        <reportSets>
          <reportSet>
            <reports>
              <report>foo</report>
            </reports>
            <configuration>
              <dependencyDetailsEnabled>true</dependencyDetailsEnabled>
              <dependencyLocationsEnabled>true</dependencyLocationsEnabled>
              <filters>
                <filter>+foo.*</filter>
                <filter>+toto.*</filter>
              </filters>
            </configuration>
          </reportSet>
          <reportSet>
            <reports>
              <report>toto</report>
            </reports>
          </reportSet>
          <configuration>
            <dependencyDetailsEnabled>true</dependencyDetailsEnabled>
            <dependencyLocationsEnabled>true</dependencyLocationsEnabled>
            <filters>
              <filter>+foo.*</filter>
              <filter>+toto.*</filter>
            </filters>
          </configuration>
        </reportSets>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>${javadocPluginVersion}</version>          
      </plugin>  
          
    </plugins>
  </reporting>

New Configuration

Not yet implemented


  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
        <version>@project.version@</version>
        <configuration>
          .....
          <reportPlugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-project-info-reports-plugin</artifactId>
              <version><at:var at:name="projectInfoReportsPluginVersion" /></version>
              <configuration>
                <dependencyDetailsEnabled>false</dependencyDetailsEnabled>
                <dependencyLocationsEnabled>false</dependencyLocationsEnabled>
              </configuration>
              <reports>
                <report>foo</report>
                <report>toto</report>
              </reports>
            </plugin>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-javadoc-plugin</artifactId>
              <version>${javadocPluginVersion}</version>          
            </plugin>            
          </reportPlugins>
        </configuration>
      </plugin>
    </plugins>


Version Resolution

Report Plugin version can be empty. The following order/strategy will be used to find/resolve a version:

  • search same groupId/artifactId in the build.plugins section.
  • search same groupId/artifactId in the build.pluginManagement.plugins section
  • resolve with current repositories (can include auto SNAPSHOT resolution)

Using maven-site-plugin 2.x with Maven 2.x and maven-site-plugin 3.x with Maven 3.x

The following snipped automatically activates maven-site-plugin 3.x when run with Maven 3.x:

  <profiles>
    <profile>
      <id>maven-3</id>
      <activation>
        <file>
          <!--  This employs that the basedir expression is only recognized by Maven 3.x (see MNG-2363) -->
          <exists>${basedir}</exists>
        </file>
      </activation>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-site-plugin</artifactId>
              <version>3.0-beta-1-SNAPSHOT</version>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>
  </profiles>
  • No labels