2011-05-18 106 views
3

我到Maven一個新手。我在我的機器上安裝了apache archiva以用作maven-proxy。我的目的是,我想用maven archiva插件生成一個示例項目結構。我已經使用archiva上傳了所需的工件。Maven原型問題

當我運行mvn原型:產生它應該問我對其餘的參數。但相反,它給了我以下錯誤。這表明我有意味着maven共享插件。但我也使用archiva上傳了maven共享插件工件。

這裏是堆棧跟蹤

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 

我在這裏偶然發現。任何形式的幫助將不勝感激。

+0

沒有在自己的計算機上安裝archiva多大用處。 (如果你與別人分享它的唯一的好) - 所以開始努力削減行家代理... – Hurda 2011-05-18 12:17:27

回答

5

由於help link指出,它看起來像你可能有一個腐敗的罐子,在這種情況下Maven的調用,2.0.x.jar。您可以檢查您的本地存儲庫並驗證它,如果需要,請將其刪除並重試。

它也可能是您的archiva本身在這種情況下,你需要在那裏刪除它的腐敗罐子。

+0

感謝的人。可能我的原型插件已損壞。我從本地存儲庫中刪除了maven-archetype-plugin。然後運行mvn archetype:generate。然後maven從指定的存儲庫下載所有需要的jar。之後,我提供了所需的投入和項目結構。 – 2011-05-19 11:05:29