首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何摆脱maven站点中调用的[警告]不推荐使用的API

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

Stack Overflow用户
提问于 2012-06-18 23:45:08
回答 2查看 1.8K关注 0票数 2

在项目上调用mvn site:site时,我喜欢摆脱以下警告

代码语言:javascript
复制
[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部分看起来像这样:

代码语言:javascript
复制
  <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返回以下输出:

代码语言:javascript
复制
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。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2012-08-25 06:06:05

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

pom.xml:

代码语言:javascript
复制
<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>部分:

代码语言:javascript
复制
<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
EN

Stack Overflow用户

发布于 2012-06-19 01:20:10

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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/11086343

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档