spring mvc template project maven plugin error

15,964

Solution 1

I found that the issue is in configuration of settings.xml

when I connected to my company's network and updated settings.xml for my company repository then it seems to work. Can I ask what is the default configuration for tags in which case I can make my sample application(nothing company specific but) run. In my settings.xml I updated following tags:

<server>
    <id>myID</id>
    <username>myuser</username>
    <password>myPassword</password>
</server>
<mirrors>
    <mirror>
        <id>mirrorId</id>
        <mirrorOf>repositoryId</mirrorOf>
        <name>Human Readable Name for this Mirror.</name>
        <url>http://my.repository.com/repo/path</url>
    </mirror>
</mirrors>
<profile>
    <id>nexus</id>
    <repositories>
        <repository>
            <id>central</id>
            <url>http://central</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>central</id>
            <url>http://central</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>
</profile>
</profiles>

What is the default configuration of above tags for running/creating a web-app?

Solution 2

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

Solution 3

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

Share:
15,964

Related videos on Youtube

nanosoft
Author by

nanosoft

I am technology enthusiast. Workin on Java backend on spring-boot with Cassandra nosql. Well versed with Oracle database

Updated on September 15, 2022

Comments

  • nanosoft
    nanosoft over 1 year

    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>