如何摆脱[警告]在maven站点中调用的不推荐使用的API

时间:2012-06-18 15:45:08

标签: java maven-2

我喜欢在项目上调用mvn site:site时删除以下警告

[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.

我的pom部分看起来像这样:

  <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>

我的mvn --version会返回以下输出:

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"

不幸的是,我无法找到正在呼喊更新的正确插件。目前无法更新/迁移到maven-3.x。

2 个答案:

答案 0 :(得分:1)

上周我遇到了同样的问题。它在maven-site插件上的问题是没有使用正确的版本。 这就是我所做的:

的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>

最后,为了选择报告,我使用<reports>部分:

<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>

答案 1 :(得分:0)

maven-site-plugin更新为3.1版。因为你也可以使用Maven 2.2.1的新版本。