maven命令创建项目失败

1 安装好maven并设置好环境变量后
2 用maven命令创建项目,在maven安装目录conf下settiing.xml添加小象镜像
3 然后用命令创建项目,失败。
mvn -B archetype:generate\
-DarchetypeGroupId=org.apache.maven.archetypes\
-DarchetypeArtifactId=maven-archetype-quickstart\
-DgroupId=com.mycompany.app\
-DartifactId=my-ap

4 报错信息如下
[root@liujunjie project]# mvn -B archetype:generate-DarchetypeGroupId=org.apache.maven.archetypes-DarchetypeArtifactId=maven-archetype-quickstart-DgroupId=com.mycompany.app-DartifactId=my-app
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.957 s
[INFO] Finished at: 2016-03-26T12:30:03+08:00
[INFO] Final Memory: 6M/28M
[INFO] ------------------------------------------------------------------------
[ERROR] Could not find goal 'generate-DarchetypeGroupId=org.apache.maven.archetypes-DarchetypeArtifactId=maven-archetype-quickstart-DgroupId=com.mycompany.app-DartifactId=my-app' in plugin org.apache.maven.plugins:maven-archetype-plugin:2.4 among available goals crawl, create, create-from-project, generate, help, integration-test, jar, update-local-catalog -> [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/conflu ... ption

fish - Hadooper

赞同来自: 唯思可达 wangxiaolei

每个反斜杠(\)前面加一个空格。

唯思可达

赞同来自:

确实这样

blueyanghualon - IT男 80后 大数据路人

赞同来自:

遇到同样的问题  我的操作是  mvn archetype:create -DgroupId=com.zhouxin.test -DartifactId=hello -DpackageName=com.zhouxin.test 异常信息如下: [DEBUG]   (f) packageName = com.zhouxin.test [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 2.927 s [INFO] Finished at: 2016-04-06T11:53:09+08:00 [INFO] Final Memory: 11M/28M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.4:create (default-cli) on project standalone-pom: Unable to parse configuration of mojo org.apache.maven.plugins:maven-archetype-plugin:2.4:create for parameter #: Cannot create instance of interface org.apache.maven.artifact.repository.ArtifactRepository -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.4:create (default-cli) on project standalone-pom: Unable to parse configuration of mojo org.apache.maven.plugins:maven-archetype-plugin:2.4:create for parameter #: Cannot create instance of interface org.apache.maven.artifact.repository.ArtifactRepository     at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:220)     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:116)     at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)     at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)     at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)     at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)     at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)     at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)     at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)     at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)     at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)     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.PluginConfigurationException: Unable to parse configuration of mojo org.apache.maven.plugins:maven-archetype-plugin:2.4:create for parameter #: Cannot create instance of interface org.apache.maven.artifact.repository.ArtifactRepository     at org.apache.maven.plugin.internal.DefaultMavenPluginManager.populatePluginFields(DefaultMavenPluginManager.java:689)     at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo(DefaultMavenPluginManager.java:621)     at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:121)     at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)     ... 20 more Caused by: org.codehaus.plexus.component.configurator.ComponentConfigurationException: Cannot create instance of interface org.apache.maven.artifact.repository.ArtifactRepository     at org.codehaus.plexus.component.configurator.converters.AbstractConfigurationConverter.instantiateObject(AbstractConfigurationConverter.java:147)     at org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.fromConfiguration(ObjectWithFieldsConverter.java:54)     at org.codehaus.plexus.component.configurator.converters.composite.AbstractCollectionConverter.fromChildren(AbstractCollectionConverter.java:54)     at org.codehaus.plexus.component.configurator.converters.composite.CollectionConverter.fromConfiguration(CollectionConverter.java:73)     at org.eclipse.sisu.plexus.CompositeBeanHelper.convertProperty(CompositeBeanHelper.java:268)     at org.eclipse.sisu.plexus.CompositeBeanHelper.setProperty(CompositeBeanHelper.java:210)     at org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.processConfiguration(ObjectWithFieldsConverter.java:101)     at org.codehaus.plexus.component.configurator.BasicComponentConfigurator.configureComponent(BasicComponentConfigurator.java:34)     at org.apache.maven.plugin.internal.DefaultMavenPluginManager.populatePluginFields(DefaultMavenPluginManager.java:659)     ... 23 more Caused by: java.lang.InstantiationException: org.apache.maven.artifact.repository.ArtifactRepository     at java.lang.Class.newInstance(Class.java:368)     at org.codehaus.plexus.component.configurator.converters.AbstractConfigurationConverter.instantiateObject(AbstractConfigurationConverter.java:143)     ... 31 more [ERROR]  [ERROR]  [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/conflu ... ption

要回复问题请先登录注册