java - 如何摆脱 [WARNING] Maven 站点中调用的已弃用 API

标签 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 目前不是一个选项。

最佳答案

我上周遇到了同样的问题。问题出在未使用正确版本的 Maven 站点插件上。 这就是我所做的:

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>

关于java - 如何摆脱 [WARNING] Maven 站点中调用的已弃用 API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11086343/

相关文章:

java - 指定 Android 网格布局中的项目以调整大小以填充屏幕高度

java - Android 简单选项卡和工具栏

java - 将类传递给 Maven2 插件

maven - Hudson 3.1.0 + Maven 2.2.1 + sonar 3.7.3 [ERROR] 加载器约束违规 : when resolving field "VISIBLE"

java - XJC xs :choice inheritance

java - Powermock junit5 和mockito2.x 不工作 RunnerTestSuiteChunker 未找到

java - 如何使用 mvn assembly :assembly? 包含 log4j.properties

java - 从 Maven 中的依赖项中排除类

maven-2 - 如何阻止Maven 2.x尝试为每个版本的依赖项检索不存在的pom.xml文件?

java - 如何隐藏 TieredCompilation 警告?