mvn archetype:create-from-project 构建模板错误

原创
2015/08/22 01:42
阅读数 2.6K
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2
.4:create-from-project (default-cli) on project caseimagesys: Error configuring
command-line. Reason: Maven executable not found at: F:\developworkspace\apache-
maven-3.3.3\bin\mvn.bat -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o
rg.apache.maven.plugins:maven-archetype-plugin:2.4:create-from-project (default-
cli) on project caseimagesys: Error configuring command-line. Reason: Maven exec
utable not found at: F:\developworkspace\apache-maven-3.3.3\bin\mvn.bat
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:212)
        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.buildProje
ct(LifecycleModuleBuilder.java:116)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:80)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThre
adedBuilder.build(SingleThreadedBuilder.java:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl
eStarter.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(DelegatingMethodAcces
sorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun
cher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
a:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
uncher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
356)
Caused by: org.apache.maven.plugin.MojoFailureException: Error configuring comma
nd-line. Reason: Maven executable not found at: F:\developworkspace\apache-maven
-3.3.3\bin\mvn.bat
        at org.apache.maven.archetype.mojos.CreateArchetypeFromProjectMojo.execu
te(CreateArchetypeFromProjectMojo.java:260)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default
BuildPluginManager.java:134)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:208)
        ... 20 more
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureExc

eption

错误原因:mvn.bat 未找到,maven 3.3.3 的 mvn 是 mvn.cmd ,但archetype-plugin 2.4 未能更新这一变化

解决方法:复制 mvn.cmd 为 mvn.bat

展开阅读全文
打赏
0
1 收藏
分享
加载中
楼主的方法完美解决,找到目录下mvn.cmd文件,将其复制一份重命名为mvn.bat。😄
2018/09/05 17:10
回复
举报
更多评论
打赏
1 评论
1 收藏
0
分享
返回顶部
顶部