Categories

A sample text widget

Etiam pulvinar consectetur dolor sed malesuada. Ut convallis euismod dolor nec pretium. Nunc ut tristique massa.

Nam sodales mi vitae dolor ullamcorper et vulputate enim accumsan. Morbi orci magna, tincidunt vitae molestie nec, molestie at mi. Nulla nulla lorem, suscipit in posuere in, interdum non magna.

Boolean Params in Jenkins

I modified an existing job in Jenkins to use a boolean flag, so I could check it if I wanted to disable the Maven tests. To do so, you define a property:

mvn -Dmaven.skip.tests=true goal goal...

So for the boolean config I set the name to maven.skip.tests and put in the Maven command config:
-Dmaven.skip.tests=${maven.skip.tests}

After running, blam! Pages of
[DEBUG] (f) session = org.apache.maven.execution.MavenSession@f372724
java.lang.reflect.InvocationTargetException
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:100)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:66)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:326)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
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:680)
Caused by: java.lang.StackOverflowError
at org.apache.maven.plugin.PluginParameterExpressionEvaluator.stripTokens(PluginParameterExpressionEvaluator.java:408)
at org.apache.maven.plugin.PluginParameterExpressionEvaluator.evaluate(PluginParameterExpressionEvaluator.java:113)
at org.apache.maven.plugin.PluginParameterExpressionEvaluator.evaluate(PluginParameterExpressionEvaluator.java:100)
at org.apache.maven.plugin.PluginParameterExpressionEvaluator.evaluate(PluginParameterExpressionEvaluator.java:385)
at org.apache.maven.plugin.PluginParameterExpressionEvaluator.evaluate(PluginParameterExpressionEvaluator.java:100)

Increase memory to -Xmx1024m. Same. Downloaded the source. Problem with recursive calls to a parse, using int exprStartDelimiter = val.indexOf( "${" );. Hmm. Some params on the build are bad?

Running in debug, I copied the command string into a shell. -bash: -Dmaven.test.skip=${maven.test.skip}: bad substitution
Hmm. I was not getting a value, just a unfilled placeholder.

mvn resources:testResources ran fine.

Little Googling. The param is $X, not ${x}. Aargh!

Now it works. On to the next problem.

Leave a Reply