maven的pom文件出現Multiple annotations found at this line...,已解決

把編好的maven項目放在另一臺電腦,pom.xml出現錯誤
Multiple annotations found at this line:
- Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile (execution: default-testCompile, phase: test-compile)
- Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:3.1: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:3.1 or one of its dependencies could not be
resolved: The repository system is offline but the artifact com.google.collections:google-collections:jar:1.0 is not available in the local repository.
- CoreException: Could not get the value for parameter compilerId for plugin execution default-testCompile: PluginResolutionException: Plugin org.apache.maven.plugins:maven-compiler-plugin:3.1 or one of its dependencies could not be
resolved: The repository system is offline but the artifact com.google.collections:google-collections:jar:1.0 is not available in the local repository.
解決方法:
將maven的repository此文件夾下的所有文件刪除
在這裏插入圖片描述
repository文件路徑在此處可以找到
在這裏插入圖片描述
重啓Eclipse IDE,在maven項目上按下Alt+F5,勾選下面兩項
在這裏插入圖片描述
等它自己慢慢下載完資源就行了
在這裏插入圖片描述
可能官網下載得很慢,這就要自己配置repository,手動下載別人下載好的repository,之後的每次進入配置pom.xml就不會再從官網下載依賴,而是在自己的本地repository裏找了

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章