简体   繁体   English

Jenkins和maven-compiler-plugin?

[英]Jenkins and maven-compiler-plugin?

I'm having a problem configuring an Jenkins, I'm running jenkins from tomcat7 [ on ubuntu ] [ downloaded from apache, not installed via apt-get ]. 我在配置Jenkins时遇到问题,我正在[从ubuntu上] [从apache下载,未通过apt-get安装]的tomcat7运行jenkins。 I have installed java from Oracle. 我已经从Oracle安装了Java。 When I want to build an project, maven is saying that maven-compiler-plugin causing an problem: 当我要构建项目时,maven表示maven-compiler-plugin引起了问题:

    org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project npa: Compilation failure
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
    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:84)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)

point is that I'm not using the maven-compiler-plugin in this version, I don't have this plugin even declared in any POM! 关键是我没有在此版本中使用maven-compiler-plugin,甚至在任何POM中都没有声明此插件! I can't add anything to the pom by myself [ don't ask why ] 我自己不能给pom添加任何内容[不要问为什么]

edit: full stack [ -X option in maven ] 编辑:完整堆栈[maven中的-X选项]

14:02:37    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
14:02:37    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
14:02:37    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
14:02:37    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
14:02:37    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
14:02:37    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
14:02:37    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
14:02:37    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
14:02:37    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
14:02:37    at org.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:79)
14:02:37    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
14:02:37    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
14:02:37    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
14:02:37    at java.lang.reflect.Method.invoke(Method.java:597)
14:02:37    at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329)
14:02:37    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239)
14:02:37    at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:158)
14:02:37    at hudson.maven.Maven3Builder.call(Maven3Builder.java:98)
14:02:37    at hudson.maven.Maven3Builder.call(Maven3Builder.java:64)
14:02:37    at hudson.remoting.UserRequest.perform(UserRequest.java:118)
14:02:37    at hudson.remoting.UserRequest.perform(UserRequest.java:48)
14:02:37    at hudson.remoting.Request$2.run(Request.java:326)
14:02:37    at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
14:02:37    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
14:02:37    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
14:02:37    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
14:02:37    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
14:02:37    at java.lang.Thread.run(Thread.java:662)
14:02:37 Caused by: org.apache.maven.plugin.CompilationFailureException: Compilation failure
14:02:37    at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:516)
14:02:37    at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:114)
14:02:37    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
14:02:37    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)

The code doesn't compile. 该代码无法编译。 The compiler plugin is included by default by Maven. Maven默认包含编译器插件。 Look at the rest of the error message to work out why the code isn't compiling. 查看错误消息的其余部分,以找出为什么代码未编译的原因。 Probably something to do with incompatible Java versions. 可能与不兼容的Java版本有关。

Edit: You are using an old version of the compiler plugin that defaults to Java 1.3 options, which is why it doesn't compile. 编辑:您使用的是旧版本的编译器插件,默认为Java 1.3选项,这就是为什么它不编译的原因。

I suspect Jenkins may be pointing to Maven 2 (see this question Maven : error: generics are not supported in -source 1.3 , I am using 1.6 ). 我怀疑詹金斯可能指向Maven 2(请参阅此问题Maven:错误:-source 1.3中不支持泛型,我正在使用1.6 )。 Make sure Jenkins is using the correct Maven 3 installation. 确保Jenkins使用正确的Maven 3安装。

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

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