简体   繁体   English

运行“ MVN全新安装”时生成失败

[英]Build failure when running “mvn clean install”

I used the following code to create the project. 我使用以下代码创建了项目。 ( I followed this tutorial ) 我遵循了本教程

git clone https://github.com/kolorobot/spring-mvc-quickstart-archetype.git
cd spring-mvc-quickstart-archetype
mvn clean install

And, when I tried to do a mvn clean install I got the following error message. 而且,当我尝试执行mvn clean install ,收到以下错误消息。

[INFO] [INFO] 1 error
[INFO] [INFO] -------------------------------------------------------------
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] BUILD FAILURE
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Total time: 6.844 s
[INFO] [INFO] Finished at: 2014-12-19T14:28:09+05:30
[INFO] [INFO] Final Memory: 11M/111M
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project basic: Compilation failure
[INFO] [ERROR] Failure executing javac, but could not parse the error:
[INFO] [ERROR] javac: invalid target release: 1.8
[INFO] [ERROR] Usage: javac <options> <source files>
[INFO] [ERROR] use -help for a list of possible options
[INFO] [ERROR] -> [Help 1]
[INFO] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project basic: Compilation failure
[INFO] Failure executing javac, but could not parse the error:
[INFO] javac: invalid target release: 1.8
[INFO] Usage: javac <options> <source files>
[INFO] use -help for a list of possible options
[INFO] 
[INFO] 
[INFO] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
[INFO] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
[INFO] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
[INFO] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
[INFO] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
[INFO] at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
[INFO] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
[INFO] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:347)
[INFO] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:154)
[INFO] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:582)
[INFO] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
[INFO] at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
[INFO] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[INFO] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[INFO] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[INFO] at java.lang.reflect.Method.invoke(Method.java:606)
[INFO] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
[INFO] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
[INFO] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
[INFO] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[INFO] Caused by: org.apache.maven.plugin.CompilationFailureException: Compilation failure
[INFO] Failure executing javac, but could not parse the error:
[INFO] javac: invalid target release: 1.8
[INFO] Usage: javac <options> <source files>
[INFO] use -help for a list of possible options
[INFO] 
[INFO] 
[INFO] at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:656)
[INFO] at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:128)
[INFO] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
[INFO] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
[INFO] ... 19 more
[INFO] [ERROR] 
[INFO] [ERROR] Re-run Maven using the -X switch to enable full debug logging.
[INFO] [ERROR] 
[INFO] [ERROR] For more information about the errors and possible solutions, please read the following articles:
[INFO] [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[INFO] Post-archetype-generation invoker exit code: 1
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 16.726 s
[INFO] Finished at: 2014-12-19T14:28:10+05:30
[INFO] Final Memory: 13M/115M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.2:integration-test (default-integration-test) on project spring-mvc-quickstart:
[ERROR] Archetype IT 'basic' failed: Execution failure: exit code = 1
[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/MojoExecutionException

How can I solve this? 我该如何解决?

您需要jdk 8来编译项目。(路径中的pom文件:“ spring-mvc-quickstart-archetype / src / main / resources / archetype-resources / pom.xml ”强制您安装jdk 8)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM