Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-70339

Maven job type does not support maven 4.0.0-alpha-3

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • maven-plugin
    • maven 4.0, git,

      ERROR: Processing failed due to a bug in the code. Please report this to the issue tracker (
      https://jenkins.io/redirect/report-an-issue
      ).
      java.lang.IllegalArgumentException: C:\Program Files\apache-maven-4.0.0-alpha-3 doesn't have a 'lib' subdirectory - thus cannot be a valid maven installation!

          [JENKINS-70339] Maven job type does not support maven 4.0.0-alpha-3

          Mark Waite added a comment -

          The Jenkins project recommends that users transition from the Maven job type to use Pipeline jobs or freestyle jobs. The risks of choosing to use that job type are described in the maven plugin documentation.

          Having said that, I think that you've made some mistake in your configuration. When I attempted to duplicate the problem as you reported it, I was unable to duplicate the problem as you reported it. I see a failure message, but it is a very different failure message than the message that you reported.

          It appears that Apache Maven 4.0.0-alpha-3 does not have the same Java classes that are available in Apache Maven 3.8.6 and earlier. Replace your maven job types with Pipeline jobs or freestyle jobs

          Freestyle job works with Apache Maven 4.0.0-alpha-3

          I confirmed that a freestyle job is able to use Apache Maven 4.0.0-alpha-3 with the following steps:

          1. Define a maven tool installer named "maven-4.0.0-alpha-3" and configure it to download the zip file from https://dlcdn.apache.org/maven/maven-4/4.0.0-alpha-3/binaries/apache-maven-4.0.0-alpha-3-bin.zip
          2. Define a freestyle job that clones https://github.com/jenkins-docs/simple-java-maven-app.git and runs a maven build step using the "maven-4.0.0-alpha-3" tool
          3. Run the freestyle job and confirm that the build is successful

          Maven job fails with no such method error

          I confirmed that a maven integration job type fails with the following steps:

          1. Define a maven tool installer named "maven-4.0.0-alpha-3" and configure it to download the zip file from https://dlcdn.apache.org/maven/maven-4/4.0.0-alpha-3/binaries/apache-maven-4.0.0-alpha-3-bin.zip
          2. Define a maven integration job that clones https://github.com/jenkins-docs/simple-java-maven-app.git using the "maven-4.0.0-alpha-3" tool and targets "clean verify"
          3. Run the maven job and confirm that the build fails. The failure message looks like this:
          Executing Maven:  -B -f C:\J\PR\workspace\Bugs-Individual\Bugs-70-000-to-79-999\JENKINS-70339-maven-use-maven-4.0.0-alpha-3\pom.xml clean verify
          java.lang.reflect.InvocationTargetException
          	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
          	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
          	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
          	at jenkins.maven3.agent.Maven35Main.launch(Maven35Main.java:179)
          	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
          	at hudson.maven.Maven3Builder.call(Maven3Builder.java:139)
          	at hudson.maven.Maven3Builder.call(Maven3Builder.java:70)
          	at hudson.remoting.UserRequest.perform(UserRequest.java:211)
          	at hudson.remoting.UserRequest.perform(UserRequest.java:54)
          	at hudson.remoting.Request$2.run(Request.java:377)
          	at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78)
          	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
          	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
          	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
          	at java.base/java.lang.Thread.run(Thread.java:829)
          Caused by: java.lang.NoSuchMethodError: 'java.util.List org.apache.maven.eventspy.internal.EventSpyDispatcher.getEventSpies()'
          	at org.jvnet.hudson.maven3.launcher.Maven35Launcher.main(Maven35Launcher.java:122)
          	... 21 more
          ERROR: Failed to parse POMs
          java.io.IOException: java.lang.reflect.InvocationTargetException
          	at hudson.maven.Maven3Builder.call(Maven3Builder.java:177)
          	at hudson.maven.Maven3Builder.call(Maven3Builder.java:70)
          	at hudson.remoting.UserRequest.perform(UserRequest.java:211)
          	at hudson.remoting.UserRequest.perform(UserRequest.java:54)
          	at hudson.remoting.Request$2.run(Request.java:377)
          	at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78)
          	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
          	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
          	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
          	at java.base/java.lang.Thread.run(Thread.java:829)
          	Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to Channel to Maven [C:\tools\jdk-11/bin/java, -cp, C:\J\PR\maven35-agent.jar;C:\J\PR\tools\hudson.tasks.Maven_MavenInstallation\maven-4.0.0.-alpha-3\apache-maven-4.0.0-alpha-3\boot\plexus-classworlds-2.6.0.jar;C:\J\PR\tools\hudson.tasks.Maven_MavenInstallation\maven-4.0.0.-alpha-3\apache-maven-4.0.0-alpha-3/conf/logging, jenkins.maven3.agent.Maven35Main, C:\J\PR\tools\hudson.tasks.Maven_MavenInstallation\maven-4.0.0.-alpha-3\apache-maven-4.0.0-alpha-3, C:\J\PR\remoting.jar, C:\J\PR\maven35-interceptor.jar, C:\J\PR\maven3-interceptor-commons.jar, 54585]
          		at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1784)
          		at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:356)
          		at hudson.remoting.Channel.call(Channel.java:1000)
          		at hudson.maven.ProcessCache$MavenProcess.call(ProcessCache.java:161)
          		at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:877)
          		at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:526)
          		at hudson.model.Run.execute(Run.java:1900)
          		at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543)
          		at hudson.model.ResourceController.execute(ResourceController.java:107)
          		at hudson.model.Executor.run(Executor.java:449)
          Caused by: java.lang.reflect.InvocationTargetException
          	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
          	at hudson.maven.Maven3Builder.call(Maven3Builder.java:139)
          	... 9 more
          Caused by: java.lang.Exception: java.lang.reflect.InvocationTargetException
          	at jenkins.maven3.agent.Maven35Main.launch(Maven35Main.java:182)
          	... 14 more
          Caused by: java.lang.reflect.InvocationTargetException
          	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
          	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
          	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
          	at jenkins.maven3.agent.Maven35Main.launch(Maven35Main.java:179)
          	... 14 more
          Caused by: java.lang.NoSuchMethodError: 'java.util.List org.apache.maven.eventspy.internal.EventSpyDispatcher.getEventSpies()'
          	at org.jvnet.hudson.maven3.launcher.Maven35Launcher.main(Maven35Launcher.java:122)
          	... 21 more
          

          Mark Waite added a comment - The Jenkins project recommends that users transition from the Maven job type to use Pipeline jobs or freestyle jobs. The risks of choosing to use that job type are described in the maven plugin documentation . Having said that, I think that you've made some mistake in your configuration. When I attempted to duplicate the problem as you reported it, I was unable to duplicate the problem as you reported it. I see a failure message, but it is a very different failure message than the message that you reported. It appears that Apache Maven 4.0.0-alpha-3 does not have the same Java classes that are available in Apache Maven 3.8.6 and earlier. Replace your maven job types with Pipeline jobs or freestyle jobs Freestyle job works with Apache Maven 4.0.0-alpha-3 I confirmed that a freestyle job is able to use Apache Maven 4.0.0-alpha-3 with the following steps: Define a maven tool installer named "maven-4.0.0-alpha-3" and configure it to download the zip file from https://dlcdn.apache.org/maven/maven-4/4.0.0-alpha-3/binaries/apache-maven-4.0.0-alpha-3-bin.zip Define a freestyle job that clones https://github.com/jenkins-docs/simple-java-maven-app.git and runs a maven build step using the "maven-4.0.0-alpha-3" tool Run the freestyle job and confirm that the build is successful Maven job fails with no such method error I confirmed that a maven integration job type fails with the following steps: Define a maven tool installer named "maven-4.0.0-alpha-3" and configure it to download the zip file from https://dlcdn.apache.org/maven/maven-4/4.0.0-alpha-3/binaries/apache-maven-4.0.0-alpha-3-bin.zip Define a maven integration job that clones https://github.com/jenkins-docs/simple-java-maven-app.git using the "maven-4.0.0-alpha-3" tool and targets "clean verify" Run the maven job and confirm that the build fails. The failure message looks like this: Executing Maven: -B -f C:\J\PR\workspace\Bugs-Individual\Bugs-70-000-to-79-999\JENKINS-70339-maven-use-maven-4.0.0-alpha-3\pom.xml clean verify java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225) at jenkins.maven3.agent.Maven35Main.launch(Maven35Main.java:179) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at hudson.maven.Maven3Builder.call(Maven3Builder.java:139) at hudson.maven.Maven3Builder.call(Maven3Builder.java:70) at hudson.remoting.UserRequest.perform(UserRequest.java:211) at hudson.remoting.UserRequest.perform(UserRequest.java:54) at hudson.remoting.Request$2.run(Request.java:377) at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) Caused by: java.lang.NoSuchMethodError: 'java.util.List org.apache.maven.eventspy.internal.EventSpyDispatcher.getEventSpies()' at org.jvnet.hudson.maven3.launcher.Maven35Launcher.main(Maven35Launcher.java:122) ... 21 more ERROR: Failed to parse POMs java.io.IOException: java.lang.reflect.InvocationTargetException at hudson.maven.Maven3Builder.call(Maven3Builder.java:177) at hudson.maven.Maven3Builder.call(Maven3Builder.java:70) at hudson.remoting.UserRequest.perform(UserRequest.java:211) at hudson.remoting.UserRequest.perform(UserRequest.java:54) at hudson.remoting.Request$2.run(Request.java:377) at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to Channel to Maven [C:\tools\jdk-11/bin/java, -cp, C:\J\PR\maven35-agent.jar;C:\J\PR\tools\hudson.tasks.Maven_MavenInstallation\maven-4.0.0.-alpha-3\apache-maven-4.0.0-alpha-3\boot\plexus-classworlds-2.6.0.jar;C:\J\PR\tools\hudson.tasks.Maven_MavenInstallation\maven-4.0.0.-alpha-3\apache-maven-4.0.0-alpha-3/conf/logging, jenkins.maven3.agent.Maven35Main, C:\J\PR\tools\hudson.tasks.Maven_MavenInstallation\maven-4.0.0.-alpha-3\apache-maven-4.0.0-alpha-3, C:\J\PR\remoting.jar, C:\J\PR\maven35-interceptor.jar, C:\J\PR\maven3-interceptor-commons.jar, 54585] at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1784) at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:356) at hudson.remoting.Channel.call(Channel.java:1000) at hudson.maven.ProcessCache$MavenProcess.call(ProcessCache.java:161) at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:877) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:526) at hudson.model.Run.execute(Run.java:1900) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543) at hudson.model.ResourceController.execute(ResourceController.java:107) at hudson.model.Executor.run(Executor.java:449) Caused by: java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at hudson.maven.Maven3Builder.call(Maven3Builder.java:139) ... 9 more Caused by: java.lang.Exception: java.lang.reflect.InvocationTargetException at jenkins.maven3.agent.Maven35Main.launch(Maven35Main.java:182) ... 14 more Caused by: java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225) at jenkins.maven3.agent.Maven35Main.launch(Maven35Main.java:179) ... 14 more Caused by: java.lang.NoSuchMethodError: 'java.util.List org.apache.maven.eventspy.internal.EventSpyDispatcher.getEventSpies()' at org.jvnet.hudson.maven3.launcher.Maven35Launcher.main(Maven35Launcher.java:122) ... 21 more

          Mark Waite added a comment -

          Maybe the mistake you made was using a maven tool installer that downloaded the "tar.gz" installer and that failed to unpack on Windows? The zip file downloader works great for me on Windows and Linux.

          Mark Waite added a comment - Maybe the mistake you made was using a maven tool installer that downloaded the "tar.gz" installer and that failed to unpack on Windows? The zip file downloader works great for me on Windows and Linux.

            Unassigned Unassigned
            arjunan Arjun
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: