Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

spring mvc template project maven plugin error

In my eclipse, I created a new project as New -> Other-> Spring -> Spring Template Project -> Spring MVC Project.

In the pom I am getting below error:

Multiple annotations found at this line: - Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (execution: default- compile, phase: compile) - CoreException: Could not calculate build plan: Plugin org.apache.maven.plugins:maven-compiler-plugin:2.5.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-compiler-plugin:jar:2.5.1: ArtifactResolutionException: Failure to transfer org.apache.maven.plugins:maven-compiler-plugin:pom:2.5.1 from
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- compiler-plugin:pom:2.5.1 from/to central repo.maven.apache.org/maven2): null to repo.maven.apache.org/maven2/org/apache/maven/plugins/ maven-compiler-plugin/2.5.1/maven-compiler-plugin-2.5.1.pom - Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:2.5.1:testCompile (execution: default- testCompile, phase: test-compile) - CoreException: Could not calculate build plan: Plugin org.apache.maven.plugins:maven-compiler-plugin:2.5.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-compiler-plugin:jar:2.5.1: ArtifactResolutionException: Could not transfer artifact org.apache.maven.plugins:maven-compiler-plugin:pom:2.5.1 from/to central (repo.maven.apache.org/maven2): null to repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/2.5.1/maven-compiler-plugin-2.5.1.pom

I did deleted the repository folder and Maven -> Update Project. But nothing worked.

Error comes at below tag:

<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.5.1</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                    <compilerArgument>-Xlint:all</compilerArgument>
                    <showWarnings>true</showWarnings>
                    <showDeprecation>true</showDeprecation>
                </configuration>
</plugin>
like image 397
nanosoft Avatar asked Dec 16 '22 13:12

nanosoft


2 Answers

In case someone else also has this problem, it was resolved in my case by selecting Maven -> Update Project

like image 187
ashario Avatar answered Dec 28 '22 08:12

ashario


I faced the same problem. I have bunch of company projects and we have our own internal maven repo and settings.xml.

But when I wanted to create a generic project, it was throwing me these errors. I work on Mac, so in eclipse > preferences > maven > User Settings I changed the path to point to the /usr/local/apache-maven/apache-maven-3.2.1/conf/settings.xml which is global one instead of pointing to ~/.m2/settings.xml which is our local company based.

Change the settings, and Right click on the project and do "Maven -> Update Project"

Hope this helps

like image 29
Krish Avatar answered Dec 28 '22 07:12

Krish