2014-12-19 3 views
1

Для создания проекта я использовал следующий код. (I followed this tutorial)Сбой сборки при запуске «mvn clean install»

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 

Как это решить?

+3

Позвольте JAVA_HOME указать на java 8 jdk –

+0

Можете ли вы рассказать мне, как вы пришли к такому выводу. Я новичок – Illep

+2

ошибка mesage говорит: недействительный целевой выпуск: 1.8. поэтому, похоже, компилятор должен скомпилировать с Java 8, но не могу. и maven получает свой javac от JAVA_HOME –

ответ

2

вам нужно JDK 8 скомпилировать проект (файл POM в пути:. "весна-MVC-Quickstart-архетип/SRC/главная/ресурсы/архетип-ресурсы/pom.xml" заставит вас иметь JDK 8 установлен).

Смежные вопросы