gpt4 book ai didi

java - 运行时构建失败 "mvn clean install"

转载 作者:行者123 更新时间:2023-11-30 03:37:12 25 4
gpt4 key购买 nike

我使用以下代码来创建项目。 (I followed this tutorial)

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

而且,当我尝试执行 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

我该如何解决这个问题?

最佳答案

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

关于java - 运行时构建失败 "mvn clean install",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27562756/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com