Getting Error in POM.xml on KEPLER Eclipse

对着背影说爱祢 提交于 2020-01-16 23:49:42

问题


I have created maven based web application so after created application i am getting two errors in pom.xml which are

1.Multiple annotations found at this line: - Failure to transfer org.apache.maven.plugins:maven-resources-plugin:pom:2.6 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.plugins:maven-resources-plugin:pom:2.6 from/to central (http:// repo.maven.apache.org/maven2): null to http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.6/maven-resources-plugin-2.6.pom

2.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 calculate build plan: Plugin org.apache.maven.plugins:maven-compiler-plugin:3.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-compiler-plugin:jar:3.1: ArtifactResolutionException: Failure to transfer org.apache.maven.plugins:maven-compiler-plugin:pom:3.1

Could you please let me know what needs to be done for resolving the issue


回答1:


If you are facing the same issue I described in my comment above then it seems I could fix it by running mvn eclipse:eclipse with working directory set to Eclipse project folder i.e.

$ cd /path/to/eclipse/workspace/Project
$ mvn eclipse:eclipse

Does this work for you ? Maybe your environment is different . Providing more details might help others to understand your problem even better so as to offer useful suggestions .




回答2:


I had similar problem Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile (execution: default-testCompile, phase: test-compile).

To Fix (apart from installing M2E plug-in and all):

  • Ensure installed maven is > 3.1 (using mvn -v). If not, you need to upgrade.
  • Ensure eclipse is pointing to correct maven location (Window->Preferences->Maven->Installations)
  • On Command prompt, go to project home directory and run mvn eclipse:clean and mvn eclipse:eclipse
  • Disable and enable Maven nature in eclipse (Right click on project, goto Maven -> Disable Maven Nature. To enable, Right click on project goto Configure -> Convert to Maven Project)


来源:https://stackoverflow.com/questions/23952407/getting-error-in-pom-xml-on-kepler-eclipse

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!