2014-02-12 135 views
3

嘗試構建maven項目時,我在我的pom.xml中收到錯誤。該錯誤是在這裏這個插件:pom.xml錯誤Maven build

 <plugin> 
     <groupId>org.apache.maven.plugins</groupId> 
     <artifactId>maven-compiler-plugin</artifactId> 
     <version>3.1</version> 
     <configuration> 
      <source>1.6</source> 
      <target>1.6</target> 
     </configuration> 
     </plugin> 

這是錯誤的Eclipse顯示:

Multiple annotations found at this line: 
- Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin: 
2.3.2:compile (execution: default-compile, phase: compile) 
- CoreException: Could not get the value for parameter compilerId for plugin execution default-compile: 
PluginResolutionException: Plugin org.apache.maven.plugins:maven-compiler-plugin:2.3.2 or one of its dependencies could not 
be resolved: Failed to collect dependencies for org.apache.maven.plugins:maven-compiler-plugin:jar:2.3.2(): 
ArtifactDescriptorException: Failed to read artifact descriptor for org.apache.maven:maven-toolchain:jar:1.0: 
ArtifactResolutionException: Failure to transfer org.apache.maven:maven-toolchain:pom:1.0 from http://repo.maven.apache.org/ 
maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or 
updates are forced. Original error: Could not transfer artifact org.apache.maven:maven-toolchain:pom:1.0 from/to central (http:// 
repo.maven.apache.org/maven2): The operation was cancelled. 
+1

問題取決於傳輸失敗者'無法從http:// repo.maven.apache.org /'傳輸org.apache.maven:maven-toolchain:pom:1.0。你有通過代理或類似的問題。首先解決您的連接問題。之後,只需刪除本地存儲庫的內容。 – khmarbaise

回答

7

好像解析失敗。

運行MVN與-U標誌忽略緩存和重新嘗試分辨率

(中高音+ F5對話框可能有所幫助)

+0

alt + f5幫助。謝謝 –

5

當我遇到了這個問題,我想通了,這是由於以前的網絡問題。本地Maven存儲庫避免了立即重新嘗試。解決此問題的最佳方法是使用eclipse「更新Maven項目」(ALT + F5)功能,最後選中「強制更新快照/發佈」選項。

0

這是不是爲我工作,改變Maven的編譯器版本2.5.1終於爲我工作,希望這來搶救的人仍然通過將用這種依賴性

<build> 
    <pluginManagement> 
     <plugins> 
       <plugin> 
        <groupId>org.apache.maven.plugins</groupId> 
        <artifactId>maven-compiler-plugin</artifactId> 
        <version>2.5.1</version> 
        <configuration> 
         <source>1.8</source> 
         <target>1.8</target> 
        </configuration> 
       </plugin> 
     </plugins> 
     </pluginManagement> 
    </build> 
0

更新Maven項目掙扎(ALT + F5)並選擇「強制更新快照/發佈」選項。

0

按(ALT + F5)更新Maven項目並選擇「強制更新快照/發佈」選項。對我也適用