Jenkins maven-project plugin doesn't support reactor module exclusion - maven

I can't get module exclusion to work with Jenkins maven plugin, see the output below:
07:11:53 Executing Maven: -B -f /home/jenkins/.jenkins/workspace/my_project/pom.xml clean cobertura:cobertura install -P nogpl,ci -pl -gotham/java/dev-server -X -e
07:12:00 Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 2014-02-14T17:37:52+00:00)
07:12:04 Maven home: /home/jenkins/.jenkins/tools/hudson.tasks.Maven_MavenInstallation/jenkins_maven
07:12:06 Java version: 1.7.0_60, vendor: Oracle Corporation
07:12:06 Java home: /usr/local/java/jdk1.7.0_60/jre
07:12:06 Default locale: en_US, platform encoding: UTF-8
07:12:06 OS name: "linux", version: "3.5.0-23-generic", arch: "amd64", family: "unix"
07:12:06 [INFO] Error stacktraces are turned on.
07:12:06 [DEBUG] Reading global settings from /home/jenkins/.jenkins/tools/hudson.tasks.Maven_MavenInstallation/jenkins_maven/conf/settings.xml
07:12:06 [DEBUG] Reading user settings from /home/jenkins/.m2/settings.xml
07:12:06 [INFO] Scanning for projects...
07:12:06 [ERROR] Could not find the selected project in the reactor: -gotham/java/dev-server -> [Help 1]
It works when I copy the command into a pre-build shell step in the same Job:
07:20:27 + mvn -B -f /home/jenkins/.jenkins/workspace/my_project/pom.xml clean cobertura:cobertura deploy -P nogpl,ci -pl -gotham/java/dev-server -X -e
07:20:27 Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 2014-02-14T17:37:52+00:00)
07:20:27 Maven home: /home/jenkins/.jenkins/tools/hudson.tasks.Maven_MavenInstallation/jenkins_maven
07:20:27 Java version: 1.7.0_60, vendor: Oracle Corporation
07:20:27 Java home: /usr/local/java/jdk1.7.0_60/jre
07:20:27 Default locale: en_US, platform encoding: UTF-8
07:20:27 OS name: "linux", version: "3.5.0-23-generic", arch: "amd64", family: "unix"
07:20:30 [INFO] Error stacktraces are turned on.
07:20:30 [DEBUG] Reading global settings from /home/jenkins/.jenkins/tools/hudson.tasks.Maven_MavenInstallation/jenkins_maven/conf/settings.xml
07:20:30 [DEBUG] Reading user settings from /home/jenkins/.m2/settings.xml
07:20:30 [DEBUG] Using local repository at /home/jenkins/.m2/repository
07:20:30 [DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10.0 for /home/jenkins/.m2/repository
07:20:30 [INFO] Scanning for projects...
[...]
07:20:31 [INFO] ------------------------------------------------------------------------
07:20:31 [INFO] Reactor Build Order:
In the stack trace you can see that hudson-maven agent is interfereing.
Notable differences are:
hudson uses org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard and shell uses ...launchEnhanced
hudson fails in org.apache.maven.DefaultMaven.trimSelectedProjects but shell fails in ...trimExcludedProjects
The full stack trace is:
Could not find the selected project in the reactor: -gotham/java/dev-server -> [Help 1]
org.apache.maven.MavenExecutionException: Could not find the selected project in the reactor: !gotham/java/dev-server
at org.apache.maven.DefaultMaven.trimSelectedProjects(DefaultMaven.java:886)
at org.apache.maven.DefaultMaven.createProjectDependencyGraph(DefaultMaven.java:820)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:268)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.jvnet.hudson.maven3.launcher.Maven32Launcher.main(Maven32Launcher.java:132)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:330)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
at jenkins.maven3.agent.Maven32Main.launch(Maven32Main.java:181)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:136)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:71)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:328)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Compare that with failure stack trace when I on purpose try to exclude a non-existent module in pre-build step:
org.apache.maven.MavenExecutionException: Could not find the selected project in the reactor: gotham/java/dev-server2
at org.apache.maven.DefaultMaven.trimExcludedProjects(DefaultMaven.java:977)
at org.apache.maven.DefaultMaven.createProjectDependencyGraph(DefaultMaven.java:821)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:268)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
I've also tried using the -pl !gotham/java/dev-server syntax and also tried not putting a space after pl like -pl!gotham/java/dev-server
Note: there is a small difference between those runs - the one executed directly from shell is Using local repository at /home/jenkins/.m2/repository while the one executed via plugin isn't. I'm not sure what is the cause but I doubt it's related
I'm using Jenkins version 1.540 with the maven-project plugin v. 2.8 (lastest)

Apparently this indeed isn't suported - https://issues.jenkins-ci.org/browse/JENKINS-26472

Related

how to use maven resource plugin correcly

There was a build failure when the project clean and install,
i think reason to build failure is maven resource plugin.
i have gotten the following error during the build the project
[DEBUG] Configuring mojo org.apache.maven.plugins:maven-resources-plugin:2.7:resources from plugin realm ClassRealm[plugin>org.apache.maven.plugins:maven-resources-plugin:2.7, parent: sun.misc.Launcher$AppClassLoader#70dea4e]
[WARNING] Error injecting: org.apache.maven.shared.filtering.DefaultMavenResourcesFiltering
java.lang.NoClassDefFoundError: Lorg/sonatype/plexus/build/incremental/BuildContext;
at java.lang.Class.getDeclaredFields0 (Native Method)
at java.lang.Class.privateGetDeclaredFields (Class.java:2583)
at java.lang.Class.getDeclaredFields (Class.java:1916)
at com.google.inject.spi.InjectionPoint.getInjectionPoints (InjectionPoint.java:675)
at com.google.inject.spi.InjectionPoint.forInstanceMethodsAndFields (InjectionPoint.java:380)
at com.google.inject.internal.ConstructorBindingImpl.getInternalDependencies (ConstructorBindingImpl.java:164)
at com.google.inject`enter code here`.internal.InjectorImpl.getInternalDependencies (InjectorImpl.java:613)
at com.google.inject.internal.InjectorImpl.cleanup (InjectorImpl.java:569)
following errors were also shown when debugging
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.291 s
[INFO] Finished at: 2017-11-04T02:15:13+05:30
[INFO] Final Memory: 10M/245M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.7:resources (default-resources) on project cas: Execution default-resources of goal org.apache.maven.plugins:maven-resources-plugin:2.7:resources failed: A required class was missing while executing org.apache.maven.plugins:maven-resources-plugin:2.7:resources: Lorg/sonatype/plexus/build/incremental/BuildContext;
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.apache.maven.plugins:maven-resources-plugin:2.7
following maven resource plugin was used in the pom
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.7</version>
please help me to solve this problem, i have tried many ways to resolve this , but still couldn't find a solution for this.
i am using the following maven version
buddika#buddika-pc:~$ mvn -version
Apache Maven 3.5.2 (138edd61fd100ec658bfa2d307c43b76940a5d7d; 2017-10-18T13:28:13+05:30)
Maven home: /usr/local/apache-maven/apache-maven-3.5.2
Java version: 1.8.0_73, vendor: Oracle Corporation
Java home: /home/buddika/installs/JDK8/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.4.0-98-generic", arch: "amd64", family: "unix"
Thank You...
NoClassDefFoundError: Lorg/sonatype/plexus/build/incremental/BuildContext. Means there is no jar of sonatype..add that jar and try to build..
Remember NoClassDefFoundError means jar is not present in your local.. add it and try..

maven deploy-file requires a project to execute but no pom file is found

I am trying to use maven deploy-file but keep getting this exception:
org.apache.maven.lifecycle.MissingProjectException: The goal you specified requires a project to execute but there is no POM in this directory (..)
using this command:
mvn -X deploy:deploy-file \
"-DrepositoryId=Private_Snapshots" \
"-Durl=https://nexus.di2e.net/nexus/content/repositories/Private_Snapshots/" \
"-DgeneratePom=true" \
"-DgroupId=Generator" \
"-DartifactId=PConfigurator" \
"-Dversion=1.1.0.0-SNAPSHOT" \
"-Dfile=./PConfigurator.apk"
My settings.xml file contains:
<servers>
<server>
<id>Private_Snapshots</id>
<username>USERNAME</username>
<password>XXXXXXXXXXXX</password>
</server>
</servers>
If a pom.xml is necessary, what would it look like?
Thanks
I tried adding -Dpackaging=android:apk or -Dpackaging=apk with similar results. There is no space between deploy and :deploy-file. Here is additional output of the failure:
+ /usr/local/apache-maven/bin/mvn -X deploy:deploy-file -DrepositoryId=Private_Snapshots -Durl=https://nexus.di2e.net/nexus/content/repositories/Private_Snapshots/ -DgeneratePom=true ' '
Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 13:51:28+0000)
Maven home: /usr/local/apache-maven
Java version: 1.8.0_91, vendor: Oracle Corporation
Java home: /opt/jdk1.8.0_91/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "2.6.32-573.12.1.el6.x86_64", arch: "amd64", family: "unix"
[INFO] Error stacktraces are turned on.
[DEBUG] Reading global settings from /usr/local/apache-maven/conf/settings.xml
[DEBUG] Reading user settings from /home/jenkins/.m2/settings.xml
[DEBUG] Using local repository at /home/jenkins/.m2/repository
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10 for /home/jenkins/.m2/repository
[INFO] Scanning for projects...
[DEBUG] Extension realms for project org.apache.maven:standalone-pom:pom:1: (none)
[DEBUG] Looking up lifecyle mappings for packaging pom from ClassRealm[plexus.core, parent: null]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.094s
[INFO] Finished at: Tue Aug 30 19:55:58 UTC 2016
[INFO] Final Memory: 6M/121M
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (.). Please verify you invoked Maven from the correct directory. -> [Help 1]
org.apache.maven.lifecycle.MissingProjectException: The goal you specified requires a project to execute but there is no POM in this directory (.). Please verify you invoked Maven from the correct directory.
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:89)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
[ERROR]
[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/MissingProjectException
I had this same problem. I removed the backslashes in the command and then it worked. So your command would be this:
mvn -X deploy:deploy-file "-DrepositoryId=Private_Snapshots" "-Durl=https://nexus.di2e.net/nexus/content/repositories/Private_Snapshots/" "-DgeneratePom=true" "-DgroupId=Generator" "-DartifactId=PConfigurator" "-Dversion=1.1.0.0-SNAPSHOT" "-Dfile=./PConfigurator.apk"

Maven failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-clean-plugin:2.5

As I am rather new to Maven I tried to create a small empty project similar to Maven in 5 Minutes. Though every time I run
mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
it I get this error:
[INFO]
------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.546 s
[INFO] Finished at: 2016-03-10T14:33:31+01:00
[INFO] Final Memory: 6M/109M
[INFO] ------------------------------------------------------------------------
[ERROR] No plugin found for prefix 'archetype' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (/home/rpod/.m2/repository), central (https://repo.maven.apache.org/maven2)] -> [Help 1]
org.apache.maven.plugin.prefix.NoPluginFoundForPrefixException: No plugin found for prefix 'archetype' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (/home/rpod/.m2/repository), central (https://repo.maven.apache.org/maven2)]
at org.apache.maven.plugin.prefix.internal.DefaultPluginPrefixResolver.resolve(DefaultPluginPrefixResolver.java:93)
at org.apache.maven.lifecycle.internal.MojoDescriptorCreator.findPluginForPrefix(MojoDescriptorCreator.java:266)
at org.apache.maven.lifecycle.internal.MojoDescriptorCreator.getMojoDescriptor(MojoDescriptorCreator.java:220)
at org.apache.maven.lifecycle.internal.DefaultLifecycleTaskSegmentCalculator.calculateTaskSegments(DefaultLifecycleTaskSegmentCalculator.java:103)
at org.apache.maven.lifecycle.internal.DefaultLifecycleTaskSegmentCalculator.calculateTaskSegments(DefaultLifecycleTaskSegmentCalculator.java:83)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:89)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[ERROR]
[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/NoPluginFoundForPrefixException
I looked up several pages though they either state that my firewall is blocking it, which I checked but it is currently inactive, or my proxy settings are wrong, which also can't be since I am not using one.
I also tried to open up those links manually and they work just fine which, I also tried to run it on a different machine and it worked out of the box.
Also my Maven version is (via the mvn --version command):
Java version: 1.8.0_66-internal, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-openjdk-amd64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.2.0-30-generic", arch: "amd64", family: "unix"
Lastly my current settings.xml setup:
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
https://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository>${user.home}/.m2/repository</localRepository>
<interactiveMode>true</interactiveMode>
<usePluginRegistry>false</usePluginRegistry>
<offline>false</offline>
</settings>
Even after looking through the entire log from executing it with the -X parameter I still don't see the issue.
Am I missing something? Thanks in advance for the help.
Try specifying the plugin+version precisely:
mvn org.apache.maven.plugins:maven-archetype-plugin:2.4:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
Also, try to check that the settings.xml you shared is the one being used. The file can live either at:
The Maven install: $M2_HOME/conf/settings.xml
A user’s install: ${user.home}/.m2/settings.xml
The user's install would override the global one.
As it turns out my JDK version was corrupted for some reason. After completely purging every directory and reinstalling both JDK and Maven it works again.
I encountered the same problem after switching my JAVA_HOME and PATH to jdk1.7.0_80 .
Switching it back to jdk1.8.0_172 solved it for me.

Hudson + Jboss AS 7.1 + Maven 3 Project Build Error

I've wanted to prepare an environment that I'm able to build my project and run my tests on a integration server. So I've installed an Jboss application server 7.1 and deployed hudson.war to it. Then I've created a project to trigger "mvn clean install" and when I built it I've got following exception.
[INFO] Using bundled Maven 3 installation
[INFO] Checking Maven 3 installation environment
[workspace] $ /disk7/hudson_home/maven/slavebundle/bundled-maven/bin/mvn --help
[INFO] Checking Maven 3 installation version
[INFO] Detected Maven 3 installation version: 3.0.3
[workspace] $ /disk7/hudson_home/maven/slavebundle/bundled-maven/bin/mvn clean install -V -B -Dmaven.ext.class.path=/disk7/hudson_home/maven/slavebundle/resources:/disk7/hudson_home/maven/slavebundle/lib/maven3-eventspy-3.0.jar:/disk7/jboss-as-7.1.0.Final/standalone/tmp/vfs/deploymentdf2a6dfa59ee3407/hudson-remoting-2.2.0.jar-407215e5de02980f/contents -Dhudson.eventspy.port=37183 -f pom.xml
[DEBUG] Waiting for connection on port: 37183
Apache Maven 3.0.3 (r1075438; 2011-02-28 19:31:09+0200)
Maven home: /disk7/hudson_home/maven/slavebundle/bundled-maven
Java version: 1.7.0_04, vendor: Oracle Corporation
Java home: /usr/lib/jvm/jdk1.7.0_04/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.2.0-24-generic", arch: "amd64", family: "unix"
[ERROR] o.h.m.e.DelegatingEventSpy - Init failed
java.lang.NoClassDefFoundError: hudson/remoting/Channel
at org.hudsonci.maven.eventspy.common.RemotingClient.open(RemotingClient.java:103) ~[maven3-eventspy-runtime.jar:na]
at org.hudsonci.maven.eventspy_30.RemotingEventSpy.openChannel(RemotingEventSpy.java:86) ~[maven3-eventspy-3.0.jar:na]
at org.hudsonci.maven.eventspy_30.RemotingEventSpy.init(RemotingEventSpy.java:114) ~[maven3-eventspy-3.0.jar:na]
at org.hudsonci.maven.eventspy_30.DelegatingEventSpy.init(DelegatingEventSpy.java:128) ~[maven3-eventspy-3.0.jar:na]
at org.apache.maven.eventspy.internal.EventSpyDispatcher.init(EventSpyDispatcher.java:84) [maven-core-3.0.3.jar:3.0.3]
at org.apache.maven.cli.MavenCli.container(MavenCli.java:403) [maven-embedder-3.0.3.jar:3.0.3]
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:191) [maven-embedder-3.0.3.jar:3.0.3]
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141) [maven-embedder-3.0.3.jar:3.0.3]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_04]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_04]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_04]
at java.lang.reflect.Method.invoke(Method.java:601) ~[na:1.7.0_04]
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290) [plexus-classworlds-2.4.jar:na]
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230) [plexus-classworlds-2.4.jar:na]
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409) [plexus-classworlds-2.4.jar:na]
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352) [plexus-classworlds-2.4.jar:na]
Caused by: java.lang.ClassNotFoundException: hudson.remoting.Channel
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50) ~[plexus-classworlds-2.4.jar:na]
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244) ~[plexus-classworlds-2.4.jar:na]
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230) ~[plexus-classworlds-2.4.jar:na]
... 16 common frames omitted
[ERROR] ABORTED
[ERROR] Failed to initialize
[ERROR] Caused by: hudson/remoting/Channel
[ERROR] Caused by: hudson.remoting.Channel
[ERROR] Failure: java.net.SocketException: Connection reset
FATAL: Connection reset
java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:189)
at java.net.SocketInputStream.read(SocketInputStream.java:121)
at java.io.FilterInputStream.read(FilterInputStream.java:133)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
at java.io.BufferedInputStream.read(BufferedInputStream.java:254)
at hudson.remoting.Channel.<init>(Channel.java:385)
at hudson.remoting.Channel.<init>(Channel.java:347)
at hudson.remoting.Channel.<init>(Channel.java:320)
at hudson.remoting.Channel.<init>(Channel.java:315)
at hudson.slaves.Channels$1.<init>(Channels.java:71)
at hudson.slaves.Channels.forProcess(Channels.java:71)
at org.hudsonci.maven.plugin.builder.internal.PerformBuild.doExecute(PerformBuild.java:174)
at org.hudsonci.utils.tasks.PerformOperation.execute(PerformOperation.java:58)
at org.hudsonci.maven.plugin.builder.MavenBuilder.perform(MavenBuilder.java:169)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:630)
at hudson.model.Build$RunnerImpl.build(Build.java:175)
at hudson.model.Build$RunnerImpl.doRun(Build.java:137)
at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:429)
at hudson.model.Run.run(Run.java:1366)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:145)
I want to point out the command which is tried to execute by hudson :
/disk7/hudson_home/maven/slavebundle/bundled-maven/bin/mvn clean install -V -B -Dmaven.ext.class.path=/disk7/hudson_home/maven/slavebundle/resources:/disk7/hudson_home/maven/slavebundle/lib/maven3-eventspy-3.0.jar:/disk7/jboss-as-7.1.0.Final/standalone/tmp/vfs/deploymentdf2a6dfa59ee3407/hudson-remoting-2.2.0.jar-407215e5de02980f/contents -Dhudson.eventspy.port=37183 -f pom.xml
It tries to find "hudson-remoting-2.2.0.jar" to put it to build path but it searches it at the wrong place because when I look where the hudson-remoting jar I found it at /disk7/jboss-as-7.1.0.Final/standalone/tmp/vfs/deploymentdf2a6dfa59ee3407/hudson-remoting-2.2.0.jar-407215e5de02980f/hudson-remoting-2.2.0.jar for this build(not in contents).
So how can I configure the hudson to force it looking at the right place for jars? Is there anyone has an idea?
Thanks in advance.
I upgrade for jboss 7 and face same problem (in jboss 6 hudson works fine). Workaround... not appropriate, but works fine. Extract hudson-remoting-2.2.0.jar in directory slavebundle/resources. I'm waiting for new version of jboss or hudson.

Trying to compile mahout but getting error - Cannot execute mojo: resources. Build is not using pom.xml

I have completed the following steps:
Installed Java 1.6
I am using Ubuntu 11.10. Added the $JAVA_HOME path in /etc/bash.bachrc
Installed maven. mvn --version is showing the installed maven correctly.
Downloaded Mahout from http://svn.apache.org/repos/asf/mahout/trunk
Now, I go inside mahout/trunk and try to do mvn clean install or mvn clean install -X -e, then it gives the follwoing error -
Cannot execute mojo: resources. It requires a project with an existing
pom.xml, but the build is not using one.
I just want to try the examples in the mahout/examples. How to fix this error?
There is a pom.xml in the directory.
Full terminal output is here:
+ Error stacktraces are turned on.
Apache Maven 2.2.1 (rdebian-6)
Java version: 1.6.0_23
Java home: /usr/lib/jvm/java-6-openjdk/jre
Default locale: en_IN, platform encoding: UTF-8
OS name: "linux" version: "3.0.0-16-generic" arch: "i386" Family: "unix"
[DEBUG] Building Maven user-level plugin registry from: '/home/kartikeya/.m2/plugin-registry.xml'
[DEBUG] Building Maven global-level plugin registry from: '/usr/share/maven2/conf/plugin-registry.xml'
[INFO] Scanning for projects...
[DEBUG] Wagons could not be registered as the extension container was never created
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Default Project
[INFO] task-segment: [clean, install]
[INFO] ------------------------------------------------------------------------
[DEBUG] Retrieving parent-POM: org.apache.maven.plugins:maven-plugins:pom:12 for project: null:maven-clean-plugin:maven-plugin:2.3 from the repository.
[DEBUG] Retrieving parent-POM: org.apache.maven:maven-parent:pom:9 for project: org.apache.maven.plugins:maven-plugins:pom:12 from the repository.
[DEBUG] Retrieving parent-POM: org.apache:apache:pom:4 for project: org.apache.maven:maven-parent:pom:9 from the repository.
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Cannot execute mojo: clean. It requires a project with an existing pom.xml, but the build is not using one.
[INFO] ------------------------------------------------------------------------
[DEBUG] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Cannot execute mojo: clean. It requires a project with an existing pom.xml, but the build is not using one.
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Cannot execute mojo: clean. It requires a project with an existing pom.xml, but the build is not using one.
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:414)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
... 17 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Wed Mar 21 11:32:36 IST 2012
[INFO] Final Memory: 2M/55M
[INFO] ------------------------------------------------------------------------
Thank you ajozwik and Owen.
I installed maven2 from the aptitude. I took the following steps to fix this issue:
Removed Maven2 sudo apt-get remove maven2
Installed Maven 3.0.4 for ubuntu as directed in - Installing maven2 without openjdk
Even after doing this, I got the error -
Unable to locate the javac Compiler in:[ERROR] /usr/lib/jvm/java-6-openjdk/jre/../lib/tools.jar
To fix this, JDK needs to be reinstalled. It worked for me!. For those even, if this solution doesn't work, please have a look at - Why maven ignores my JAVA_HOME?
Regards.
"Cannot execute mojo: resources. It requires a project with an existing pom.xml"
This error means there is not pom.xml in the working directory

Resources