سؤال

I'm having a problem configuring an Jenkins, I'm running jenkins from tomcat7 [ on ubuntu ] [ downloaded from apache, not installed via apt-get ]. I have installed java from Oracle. When I want to build an project, maven is saying that maven-compiler-plugin causing an problem:

    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! I can't add anything to the pom by myself [ don't ask why ]

edit: full stack [ -X option in maven ]

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. 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.

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.

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). Make sure Jenkins is using the correct Maven 3 installation.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top