Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Hudson » Hudson and modules activated via parameterized profile(Hudson fails to build project with parameters used for profile)
Hudson and modules activated via parameterized profile [message #844191] Fri, 13 April 2012 19:51 Go to next message
Jay Blanton is currently offline Jay BlantonFriend
Messages: 2
Registered: April 2012
Junior Member
There is a bug reported for Jenkins that has information related specifically to the type of issue we are having with Hudson 2.2.0 (with both maven 2.2.0 and maven 3.0.4).

issues.jenkins-ci.org/browse/JENKINS-2295

We utilize build parameters so we can customize our maven command, for example (providing a drop-down with all our different envs so that a build person can select the environment they want and this gets substituted into the build section of the mvn package).

The problem is we want to be able to parameterize profiles that contain modules. So there isn't a problem using parameters that resolve profiles if those profiles just hold properties...for instance:

<profile>
<id>sample</id>
<properties>
<target.names>${sample.name}</target.names>
<deploy.port>${sample.port}</deploy.port>
<deploy.hostname>${sample.hostname}</deploy.hostname>
<deploy.user>${sample.userId}</deploy.user>
<deploy.password>${sample.password}</deploy.password>
</properties>
</profile>

We can have a String Param = CONTAINER that takes an env property and have a command that does something like:

mvn package -P$CONTAINER -fae

And this works fine because the profile contains only properties.

The problem occurs when one of our profiles contains modules. Even if I go in and comment out all plugins/dependencies/functionality in the modules plugins - we receive the NullPointerException...so for instance:

<profile>
<id>projects-to-build</id>
<modules>
<module>sample-proj-1</module>
<module>sample-proj-2</module>
</modules>
</profile>

If we have a String param = PROFILE and it is set to projects-to-build, then Hudson will correctly output (in the console) the correct mvn command:

mvn package -P$PROFILE -fae

Becomes the following in the console

mvn package -Pprojects-to-build -fae

But after the reactor is built and the module poms are going to be processed, we receive:

mavenExecutionResult exceptions not empty
message : Internal error: java.lang.NullPointerException
cause : null
Stack trace :
org.apache.maven.InternalErrorException: Internal error: java.lang.NullPointerException
at org.apache.maven.lifecycle.internal.BuilderCommon.handleBuildError(BuilderCommon.java:128)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:95)
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)
at org.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:79)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239)
at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:158)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:104)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:70)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:287)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NullPointerException
at hudson.maven.Maven3Builder$MavenExecutionListener.recordProjectStarted(Maven3Builder.java:286)
at hudson.maven.Maven3Builder$MavenExecutionListener.projectStarted(Maven3Builder.java:276)
at org.jfrog.build.extractor.maven.BuildInfoRecorder.projectStarted(BuildInfoRecorder.java:149)
at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire(DefaultExecutionEventCatapult.java:71)
at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire(DefaultExecutionEventCatapult.java:42)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:78)
... 24 more

Is anyone else seeing this problem? This is holding us back from utilizing smarter jobs so that we can create one job regardless of what we are building and using the parameters so that we can dynamic set the profile during build time. But without this working, someone has to manually reconfigure the job everytime they want to change the profile or create duplicate jobs for different profiles.

Thanks..
Re: Hudson and modules activated via parameterized profile [message #867922 is a reply to message #844191] Tue, 01 May 2012 14:54 Go to previous messageGo to next message
Winston Prakash is currently offline Winston PrakashFriend
Messages: 534
Registered: August 2011
Location: Fremont, CA USA
Senior Member
Hi Jay,

This appears to happen with Maven 2 Legacy plugin. Have you tried with
Freeform project and maven3 builder instead.

- Winston

On 4/13/12 12:51 PM, Jay Blanton wrote:
> There is a bug reported for Jenkins that has information related
> specifically to the type of issue we are having with Hudson 2.2.0 (with
> both maven 2.2.0 and maven 3.0.4).
>
> issues.jenkins-ci.org/browse/JENKINS-2295
>
> We utilize build parameters so we can customize our maven command, for
> example (providing a drop-down with all our different envs so that a
> build person can select the environment they want and this gets
> substituted into the build section of the mvn package).
>
> The problem is we want to be able to parameterize profiles that contain
> modules. So there isn't a problem using parameters that resolve
> profiles if those profiles just hold properties...for instance:
>
> <profile>
> <id>sample</id>
> <properties>
> <target.names>${sample.name}</target.names>
> <deploy.port>${sample.port}</deploy.port>
> <deploy.hostname>${sample.hostname}</deploy.hostname>
> <deploy.user>${sample.userId}</deploy.user>
> <deploy.password>${sample.password}</deploy.password>
> </properties>
> </profile>
>
> We can have a String Param = CONTAINER that takes an env property and
> have a command that does something like:
>
> mvn package -P$CONTAINER -fae
>
> And this works fine because the profile contains only properties.
>
> The problem occurs when one of our profiles contains modules. Even if I
> go in and comment out all plugins/dependencies/functionality in the
> modules plugins - we receive the NullPointerException...so for instance:
>
> <profile>
> <id>projects-to-build</id>
> <modules>
> <module>sample-proj-1</module>
> <module>sample-proj-2</module>
> </modules>
> </profile>
>
> If we have a String param = PROFILE and it is set to projects-to-build,
> then Hudson will correctly output (in the console) the correct mvn command:
>
> mvn package -P$PROFILE -fae
>
> Becomes the following in the console
>
> mvn package -Pprojects-to-build -fae
>
> But after the reactor is built and the module poms are going to be
> processed, we receive:
>
> mavenExecutionResult exceptions not empty
> message : Internal error: java.lang.NullPointerException
> cause : null
> Stack trace : org.apache.maven.InternalErrorException: Internal error:
> java.lang.NullPointerException
> at
> org.apache.maven.lifecycle.internal.BuilderCommon.handleBuildError(BuilderCommon.java:128)
>
> at
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:95)
>
> 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)
> at
> org.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:79)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329)
>
> at
> org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239)
> at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:158)
> at hudson.maven.Maven3Builder.call(Maven3Builder.java:104)
> at hudson.maven.Maven3Builder.call(Maven3Builder.java:70)
> at hudson.remoting.UserRequest.perform(UserRequest.java:118)
> at hudson.remoting.UserRequest.perform(UserRequest.java:48)
> at hudson.remoting.Request$2.run(Request.java:287)
> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
> at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
> at java.util.concurrent.FutureTask.run(FutureTask.java:138)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>
> at java.lang.Thread.run(Thread.java:619)
> Caused by: java.lang.NullPointerException
> at
> hudson.maven.Maven3Builder$MavenExecutionListener.recordProjectStarted(Maven3Builder.java:286)
>
> at
> hudson.maven.Maven3Builder$MavenExecutionListener.projectStarted(Maven3Builder.java:276)
>
> at
> org.jfrog.build.extractor.maven.BuildInfoRecorder.projectStarted(BuildInfoRecorder.java:149)
>
> at
> org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire(DefaultExecutionEventCatapult.java:71)
>
> at
> org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire(DefaultExecutionEventCatapult.java:42)
>
> at
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:78)
>
> .. 24 more
>
> Is anyone else seeing this problem? This is holding us back from
> utilizing smarter jobs so that we can create one job regardless of what
> we are building and using the parameters so that we can dynamic set the
> profile during build time. But without this working, someone has to
> manually reconfigure the job everytime they want to change the profile
> or create duplicate jobs for different profiles.
>
> Thanks..


Winston Prakash
Eclipse Hudson team
Re: Hudson and modules activated via parameterized profile [message #869609 is a reply to message #867922] Thu, 03 May 2012 17:35 Go to previous message
Jay Blanton is currently offline Jay BlantonFriend
Messages: 2
Registered: April 2012
Junior Member
Thanks...that worked like a charm.

Is there a plugin for Hudson that can convert Legacy Jobs to Free-style (freeform) projects?
Previous Topic:Debugging Subversion plugin
Next Topic:File Not Found hudson.repo
Goto Forum:
  


Current Time: Thu Apr 25 19:51:14 GMT 2024

Powered by FUDForum. Page generated in 0.02574 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top