问题描述
我是新手.我已经在我的机器上安装了Apache archiva以用作maven-proxy.我的目的是要使用maven archiva插件生成示例项目结构.我已经使用archiva上传了所需的工件.
I am a newbie to maven. I have installed apache archiva in my machine to use as maven-proxy. My purpose is that I want to generate a sample project structure using maven archiva plugin. I have uploaded required artifact using archiva for that.
当我运行mvn archetype:generate时,应该向我询问其余的参数.但是,它却给了我以下错误.这表明我有Maven共享插件.但是我也使用archiva上传了Maven共享插件工件.
When I run mvn archetype:generate it should ask me for the rest of the parameters. But instead it is giving me the following errors. Which indicates I have means maven shared plugin. But I have also uploaded the maven shared plugin artifact using archiva.
这是堆栈跟踪
F:\MavenTests\simple>mvn archetype:generate
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-archetype-plugin:2.0:generate (default-cli) @ standalone-pom >>>
[INFO]
[INFO] <<< maven-archetype-plugin:2.0:generate (default-cli) @ standalone-pom <<<
[INFO]
[INFO] --- maven-archetype-plugin:2.0:generate (default-cli) @ standalone-pom ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.276s
[INFO] Finished at: Wed May 18 17:11:05 ALMT 2011
[INFO] Final Memory: 3M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.0:generate (default-cli) on project standalone-pom: Exe
lugins:maven-archetype-plugin:2.0'. A required class is missing: org/apache/maven/shared/invoker/MavenInvocationException
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.apache.maven.plugins:maven-archetype-plugin:2.0
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/C:/Users/mae/.m2/repository/org/apache/maven/plugins/maven-archetype-plugin/2.0/maven-archetype-plugin-2.0.jar
[ERROR] urls[1] = file:/C:/Users/mae/.m2/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
[ERROR] Number of foreign imports: 4
[ERROR] import: Entry[import org.codehaus.plexus.util.xml.pull.XmlSerializer from realm ClassRealm[plexus.core, parent: null]]
[ERROR] import: Entry[import org.codehaus.plexus.util.xml.pull.XmlPullParserException from realm ClassRealm[plexus.core, parent: null]]
[ERROR] import: Entry[import org.codehaus.plexus.util.xml.pull.XmlPullParser from realm ClassRealm[plexus.core, parent: null]]
[ERROR] import: Entry[import org.codehaus.plexus.util.xml.Xpp3Dom from realm ClassRealm[plexus.core, parent: null]]
[ERROR]
[ERROR] realm = maven.api
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] Number of foreign imports: 21
[ERROR] import: Entry[import org.sonatype.aether from realm ClassRealm[plexus.core, parent: null]]
[ERROR] import: Entry[import org.codehaus.plexus.personality from realm ClassRealm[plexus.core, parent: null]]
[ERROR] import: Entry[import org.codehaus.plexus.logging from realm ClassRealm[plexus.core, parent: null]]
[ERROR] import: Entry[import org.codehaus.plexus.lifecycle from realm ClassRealm[plexus.core, parent: null]]
[ERROR] import: Entry[import org.codehaus.plexus.context from realm ClassRealm[plexus.core, parent: null]]
[ERROR] import: Entry[import org.codehaus.plexus.container from realm ClassRealm[plexus.core, parent: null]]
[ERROR] import: Entry[import org.codehaus.plexus.configuration from realm ClassRealm[plexus.core, parent: null]]
[ERROR] import: Entry[import org.codehaus.plexus.component from realm ClassRealm[plexus.core, parent: null]]
[ERROR] import: Entry[import org.codehaus.plexus.classworlds from realm ClassRealm[plexus.core, parent: null]]
[ERROR] import: Entry[import org.codehaus.plexus.PlexusContainerException from realm ClassRealm[plexus.core, parent: null]]
[ERROR] import: Entry[import org.codehaus.plexus.PlexusContainer from realm ClassRealm[plexus.core, parent: null]]
[ERROR] import: Entry[import org.codehaus.plexus.PlexusConstants from realm ClassRealm[plexus.core, parent: null]]
[ERROR] import: Entry[import org.codehaus.plexus.MutablePlexusContainer from realm ClassRealm[plexus.core, parent: null]]
[ERROR] import: Entry[import org.codehaus.plexus.DuplicateChildContainerException from realm ClassRealm[plexus.core, parent: null]]
[ERROR] import: Entry[import org.codehaus.plexus.DefaultPlexusContainer from realm ClassRealm[plexus.core, parent: null]]
[ERROR] import: Entry[import org.codehaus.plexus.DefaultContainerConfiguration from realm ClassRealm[plexus.core, parent: null]]
[ERROR] import: Entry[import org.codehaus.plexus.DefaultComponentRegistry from realm ClassRealm[plexus.core, parent: null]]
[ERROR] import: Entry[import org.codehaus.plexus.ContainerConfiguration from realm ClassRealm[plexus.core, parent: null]]
[ERROR] import: Entry[import org.codehaus.plexus.ComponentRegistry from realm ClassRealm[plexus.core, parent: null]]
[ERROR] import: Entry[import org.codehaus.classworlds from realm ClassRealm[plexus.core, parent: null]]
[ERROR] import: Entry[import org.apache.maven from realm ClassRealm[plexus.core, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------: org.apache.maven.shared.invoker.MavenInvocationException
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[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/PluginContainerException
我在这里偶然发现.任何帮助将不胜感激.
I am stumbled upon here. Any kind of help would be highly appreciated.
推荐答案
作为帮助链接指出,您的jar似乎已损坏,在本例中为maven-invoker-2.0.x.jar.您可以检查本地存储库并进行验证,如果需要,可以将其删除并重试.
As the help link points out, it looks like you may have a corrupt jar, in this case maven-invoker-2.0.x.jar. You can examine your local repository and verify it and if required delete it and retry.
您的档案文件本身也可能有损坏的jar,在这种情况下,您需要在其中删除它.
It is also possible that your archiva itself has the corrupt jar in which case you need to delete it there.
这篇关于Maven原型问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!