2015-03-13 14 views
0

我正在从命令行运行AppFuse。我安装了Maven 3.2.1和Java 1.7。我收到错误:archtype未配置。我有点惊讶,因为我使用的是来自appfuse网站的命令。appfuse的原型未配置且构建失败

这里是我使用的命令:

mvn -e archetype:generate -B -DarchetypeGroupId=org.appfuse.archetypes -DarchetypeArtifactId=appfuse-basic-spring-archetype -DarchetypeVersion=3.5.0 -DgroupId=net.novogrodsky -DartifactId=myproject -DarchetypeRepository=https://oss.sonatype.org/content/repositories/appfuse 

这里有更多的细节和错误跟踪:

mvn -e archetype:generate -B -DarchetypeGroupId=org.appfuse.archetypes -DarchetypeArtifactId=appfuse-basic-spring-archetype -DarchetypeVersion=3.5.0 -DgroupId=net.novogrodsky -DartifactId=myproject -DarchetypeRepository=https://oss.sonatype.org/content/repositories/appfuse 
[INFO] Error stacktraces are turned on. 
[INFO] Scanning for projects... 
[INFO] 
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1 
[INFO] 
[INFO] ------------------------------------------------------------------------ 
[INFO] Building Maven Stub Project (No POM) 1 
[INFO] ------------------------------------------------------------------------ 
[INFO] 
[INFO] >>> maven-archetype-plugin:2.0-alpha-2:generate (default-cli) @ standalone-pom >>> 
[INFO] 
[INFO] <<< maven-archetype-plugin:2.0-alpha-2:generate (default-cli) @ standalone-pom <<< 
[INFO] 
[INFO] --- maven-archetype-plugin:2.0-alpha-2:generate (default-cli) @ standalone-pom --- 
[INFO] Setting property: classpath.resource.loader.class => 'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'. 
[INFO] Setting property: velocimacro.messages.on => 'false'. 
[INFO] Setting property: resource.loader => 'classpath'. 
[INFO] Setting property: resource.manager.logwhenfound => 'false'. 
[INFO] Archetype defined by properties 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 1.989 s 
[INFO] Finished at: 2015-03-13T14:20:33-06:00 
[INFO] Final Memory: 11M/164M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.0-alpha-2:generate (default-cli) on project standalone-pom: The archetype is not configured -> [Help 1] 
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.0-alpha-2:generate (default-cli) on project standalone-pom: The archetype is not configured 
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216) 
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) 
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) 
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:108) 
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76) 
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) 
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116) 
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361) 
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155) 
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584) 
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213) 
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:157) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:606) 
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) 
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) 
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) 
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) 
Caused by: org.apache.maven.plugin.MojoExecutionException: The archetype is not configured 
    at org.apache.maven.archetype.mojos.CreateProjectFromArchetypeMojo.execute(CreateProjectFromArchetypeMojo.java:174) 
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133) 
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208) 
    ... 19 more 
Caused by: org.apache.maven.archetype.exception.ArchetypeNotConfigured: The archetype is not configured 
    at org.apache.maven.archetype.ui.DefaultArchetypeGenerationConfigurator.configureArchetype(DefaultArchetypeGenerationConfigurator.java:210) 
    at org.apache.maven.archetype.mojos.CreateProjectFromArchetypeMojo.execute(CreateProjectFromArchetypeMojo.java:168) 
    ... 21 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/MojoExecutionException 
+0

它看起来像你使用旧版本的Archetype插件。你可以尝试“mvn -U archetype:generate”并查看它是否下载新版本? – 2015-03-16 14:52:27

+0

谢谢,解决了这个问题。 – Dave 2015-03-16 18:32:49

回答

0

运行 “MNV -U原型:产生” 更新Archetype插件。之后,一切都奏效了。