2012-06-18 49 views
2

我想擺脫以下警告,同時在一個項目叫mvn site:siteHOWTO擺脫稱爲Maven站點[警告]過時的API

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

我的聚甲醛的部分看起來像這樣的:

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

Unluck ily,我無法找到正在呼叫更新的正確插件。更新/遷移到maven-3.x目前不是一種選擇。

+0

你爲什麼叫MVN網站站點,而不是mvn網站?此外,爲什麼更新Maven 3.0沒有選擇? MVN 2.2.1和3.0.4之間唯一的巨大差別是似乎正在建設中的網站生成部分。 – khmarbaise

+0

mvn網站:到目前爲止,網站顯示的是相同的警告。 Maven目前無法遷移,因爲我的公司受這個版本的政策約束。 – Rob

回答

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

完美地工作。謝謝 – Rob

0

maven-site-plugin更新至版本3.1。因爲您也可以使用Maven 2.2.1的較新版本。

+0

我不確定,如果我確實這樣做了......我只是將 2.4標記更改爲 3.1。 Maven下載了更新的版本,並向我展示了與我的問題中提到的相同的錯誤。 – Rob

+0

你有一個pluginManagement部分的地方嗎?如果是,請在pluginManagement中定義版本。 – khmarbaise

+0

目前我不使用''的地方。版本位於''下面插件部分的唯一位置。 – Rob