4

I am getting an error in my pom.xml when trying to build a maven project. The error is here on this plugin:

      <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>

This is the error Eclipse shows:

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.
aldrinleal
  • 3,559
  • 26
  • 33
Chirag
  • 335
  • 2
  • 3
  • 13
  • 1
    The problem is depending on the transfer failurer `Failure to transfer org.apache.maven:maven-toolchain:pom:1.0 from http://repo.maven.apache.org/`. You have problems going through a proxy or something similar. First fix your connection problems. After that just delete the contents of your local repository. – khmarbaise Feb 12 '14 at 08:13

6 Answers6

9

Seems like the resolution failed.

Run mvn with the -U flag to disregard the cache and re-attempt resolution

(the alt+f5 dialog might help as well)

aldrinleal
  • 3,559
  • 26
  • 33
9

When I ran into this problem I figured out that it was due to a previous network problem. The local Maven repository avoids immediate reattempts. The best way to solve this was to use the eclipse "Update Maven Project" (ALT+F5) feature end check the option "Force Update of Snapshots/Releases".

SebastianH
  • 2,172
  • 1
  • 18
  • 29
0

This was not working for me , changing maven compiler version to 2.5.1 finally worked for me , hopefully this comes to rescue for anyone still struggling with this dependency

<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

Update Maven Project by pressing (ALT+F5) and select the option "Force Update of Snapshots/Releases".

jediz
  • 4,459
  • 5
  • 36
  • 41
0

Update Maven Project by pressing (ALT+F5) and select the option "Force Update of Snapshots/Releases". works for me also

0

Got similar issue. Maven update and force update of snapshot didn't work for me.

Did following steps, issue resolved:

  1. Remove project in eclipse.
  2. Delete .Project file and . Settings folder.
  3. Import project as existing maven project again to eclipse.
Way
  • 11
  • 1