Search code examples
javamaven-2

Howto get rid of [WARNING] Deprecated API called in maven site


I like to get rid of the following warning while calling mvn site:site on a project

[INFO] Generating "About" report. 
[WARNING] Deprecated API called - not org.apache.maven.doxia.sink.Sink instance and no SinkFactory available. Please update this plugin. 
[INFO] Generating "Issue Tracking" report. 
[WARNING] Deprecated API called - not org.apache.maven.doxia.sink.Sink instance and no SinkFactory available. Please update this plugin. 
[INFO] Generating "PMD Report" report. 
[WARNING] Deprecated API called - not org.apache.maven.doxia.sink.Sink instance and no SinkFactory available. Please update this plugin. 
[WARNING] Unable to locate Source XRef to link to - DISABLED 
[INFO] Generating "Continuous Integration" report. 
[WARNING] Deprecated API called - not org.apache.maven.doxia.sink.Sink instance and no SinkFactory available. Please update this plugin. 
[INFO] Generating "Source Repository" report. 
[WARNING] Deprecated API called - not org.apache.maven.doxia.sink.Sink instance and no SinkFactory available. Please update this plugin. 
[INFO] Generating "Project License" report. 
[WARNING] Deprecated API called - not org.apache.maven.doxia.sink.Sink instance and no SinkFactory available. Please update this plugin. 
[INFO] Generating "CPD Report" report. 
[WARNING] Deprecated API called - not org.apache.maven.doxia.sink.Sink instance and no SinkFactory available. Please update this plugin.

The part of my pom looks like this:

  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <version>2.4</version>
        <reportSets>
          <reportSet>
            <reports>
              <report>index</report>
              <report>cim</report>
              <report>issue-tracking</report>
              <report>license</report>
              <report>scm</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
        <version>2.4</version>
      </plugin>            
    </plugins>
  </reporting>

My mvn --version returns the following output:

Apache Maven 2.2.1 (r801777; 2009-08-06 21:16:01+0200)
Java version: 1.6.0_10
Java home: /opt/jdk1.6.0_10/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux" version: "2.6.32-41-generic" arch: "i386" Family: "unix"

Unluckily I'm unable to find the correct plugin that cries for an update. Updating/Migrating to maven-3.x is not an option at the moment.


Solution

  • I had the same problem last week. The problem its on the maven-site plugin which is not using the correct version. This is what I did:

    pom.xml:

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <version>2.1.1</version>
    </plugin>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
        <version>3.1</version>
    </plugin>
    

    Finally to select the reports, I use the <reports> section:

    <project>
    ...
    <plugins>
    <reporting>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <version>2.5</version>
        <reportSets>
          <reportSet>
             <reports>
           <report>index</report>
           <report>project-team</report>
               <report>issue-tracking</report>
           <report>summary</report>
         </reports>
          </reportSet>
        </reportSets>
    </plugin>
    </plugins>
    </reporting>
    ...
    </project>