Maven Build Failure - Inability to Find Plugins

I created the project using the m2 eclipse tool, and now I have chosen the archetype of the web application if I try to pack this empty application. I get build failure by saying

[ERROR] Plugin org.apache.maven.plugins:maven-war-plugin:2.1 or one of its dependencies could not be resolved: Failure to find org.apache.maven.plugins:maven-war-plugin:jar:2.1 in http://repo1.maven.org/maven2 was cached in the local repository, resolution will not be reattempted until the update in
terval of central has elapsed or updates are forced -> [Help 1]
org.apache.maven.plugin.PluginResolutionException: Plugin org.apache.maven.plugins:maven-war-plugin:2.1 or one of its dependencies could not be resolv
ed: Failure to find org.apache.maven.plugins:maven-war-plugin:jar:2.1 in http://repo1.maven.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
        at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:96)
        at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getPluginDescriptor(DefaultMavenPluginManager.java:136)
        at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getMojoDescriptor(DefaultMavenPluginManager.java:251)
        at org.apache.maven.plugin.DefaultBuildPluginManager.getMojoDescriptor(DefaultBuildPluginManager.java:197)
        at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.setupMojoExections(DefaultLifecycleExecutionPlanCalculator.java
:134)
        at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan(DefaultLifecycleExecutionPlanCalculator.
java:116)
        at org.apache.maven.lifecycle.internal.BuilderCommon.resolveBuildPlan(BuilderCommon.java:92)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:314)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:151)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:445)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:168)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:132)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.sonatype.aether.resolution.ArtifactResolutionException: Failure to find org.apache.maven.plugins:maven-war-plugin:jar:2.1 in http://rep
o1.maven.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
        at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:488)
        at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:190)
        at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveArtifact(DefaultRepositorySystem.java:250)
        at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:92)
        ... 23 more
Caused by: org.sonatype.aether.transfer.ArtifactNotFoundException: Failure to find org.apache.maven.plugins:maven-war-plugin:jar:2.1 in http://repo1.m
aven.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
        at org.sonatype.aether.impl.internal.DefaultUpdateCheckManager.checkArtifact(DefaultUpdateCheckManager.java:191)
        at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:384)
        ... 26 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException

Now I tried updating the ect repository, but I was out of luck.

At the suggestion, I tried to update the registry of plugins, but there is no such pugin-registry.xml file in my file system.

It also builds fine inside eclipse, but fails to execute the command, so I assume they both use different versions. How to fix it?

+5
source share
4 answers

Try using the flag -cpu. Exit from mvn -help:

usage: mvn [options] [<goal(s)>] [<phase(s)>]

Options:
 -cpu,--check-plugin-updates            Force upToDate check for any
                                        relevant registered plugins
+6
source

, Maven. , . , .

+2

, . , .

project → properties → Maven →

, . xml .

+1

, maven v 3.0.4.

0
source

All Articles