[JIRA] (JENKINS-40712) Exception when using mavenSettingsConfig

18 views
Skip to first unread message

kent@clubsalino.com (JIRA)

unread,
Dec 29, 2016, 3:25:02 AM12/29/16
to jenkinsc...@googlegroups.com
Kent Granström created an issue
 
Jenkins / Bug JENKINS-40712
Exception when using mavenSettingsConfig
Issue Type: Bug Bug
Assignee: Dominik Bartholdi
Components: config-file-provider-plugin, pipeline-maven-plugin
Created: 2016/Dec/29 8:24 AM
Environment: Jenkins 2.38, pipeline-maven-plugin 0.4 config-file-provider 2.15.1
Priority: Major Major
Reporter: Kent Granström

The usage of withMaven() and the mavenSettingsConfig appears to have been broken when I installed the 2.15.1 version of the config-file-provider.

Had a perfectly working setup for a pipeline using 'withMaven' pointing to a configuration made in the config-file section of Jenkins using this simple test:

        // Build the project.
        stage("Build") {
            withMaven(  maven                   : 'maven333', 
                        mavenLocalRepo          : '.repo',
                        mavenSettingsConfig    : 'my-settings-test')
            {
                sh "mvn -X clean -T2C"
            }
        }

After the updates of the plugins I get this exception:

08:55:42 Using Maven Installation maven333
08:55:42 Using maven exec: /var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/maven333/bin/mvn
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] }
[Pipeline] // timestamps
[Pipeline] End of Pipeline
java.lang.NoSuchMethodError: org.jenkinsci.lib.configprovider.model.Config.getByIdOrNull(Ljava/lang/String;)Lorg/jenkinsci/lib/configprovider/model/Config;
	at org.jenkinsci.plugins.pipeline.maven.WithMavenStepExecution.settingsFromConfig(WithMavenStepExecution.java:525)
	at org.jenkinsci.plugins.pipeline.maven.WithMavenStepExecution.setupSettingFile(WithMavenStepExecution.java:453)
	at org.jenkinsci.plugins.pipeline.maven.WithMavenStepExecution.setupMaven(WithMavenStepExecution.java:219)
	at org.jenkinsci.plugins.pipeline.maven.WithMavenStepExecution.start(WithMavenStepExecution.java:138)
	at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:184)
	at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:126)
	at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:108)
	at groovy.lang.GroovyObject$invokeMethod$0.call(Unknown Source)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
	at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:151)
	at org.kohsuke.groovy.sandbox.GroovyInterceptor.onMethodCall(GroovyInterceptor.java:21)
	at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:115)
	at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:149)
	at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:146)
	at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:123)
	at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:123)
	at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:123)
	at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall(SandboxInvoker.java:16)
	at WorkflowScript.run(WorkflowScript:37)
	at ___cps.transform___(Native Method)
	at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:57)
	at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:109)
	at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:82)
	at sun.reflect.GeneratedMethodAccessor284.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
	at com.cloudbees.groovy.cps.impl.ClosureBlock.eval(ClosureBlock.java:46)
	at com.cloudbees.groovy.cps.Next.step(Next.java:58)
	at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:154)
	at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:18)
	at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:33)
	at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:30)
	at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:108)
	at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:30)
	at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:163)
	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:324)
	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$100(CpsThreadGroup.java:78)
	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:236)
	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:224)
	at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:63)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112)
	at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Finished: FAILURE

Strange note: If I rename the 'mavenSettingsConfig' to something else, 'mavenXYZ' for instance, then I don't get the exception. That however doesn't point out my settings-file so it doesn't do me any good.

For now, the workaround is to use the 'mavenSettingsFilePath' and point to the settings-file I want to use.

PS: None of the settings file configurations I have set up shows up in the "Snippet Generator". May perhaps be a connection to what I have described above...

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

domi@fortysix.ch (JIRA)

unread,
Dec 29, 2016, 3:29:02 AM12/29/16
to jenkinsc...@googlegroups.com

domi@fortysix.ch (JIRA)

unread,
Dec 29, 2016, 3:30:02 AM12/29/16
to jenkinsc...@googlegroups.com
Dominik Bartholdi assigned an issue to Cyrille Le Clerc
Change By: Dominik Bartholdi
Assignee: Dominik Bartholdi Cyrille Le Clerc

kent@clubsalino.com (JIRA)

unread,
Dec 29, 2016, 3:47:01 AM12/29/16
to jenkinsc...@googlegroups.com

Synchronization is the word here

cleclerc@cloudbees.com (JIRA)

unread,
Dec 29, 2016, 3:53:01 AM12/29/16
to jenkinsc...@googlegroups.com

Dominik Bartholdi it seems that we have to release the Pipeline Maven Plugin ASAP with your PR, correct?

cleclerc@cloudbees.com (JIRA)

unread,
Dec 29, 2016, 3:53:01 AM12/29/16
to jenkinsc...@googlegroups.com
Cyrille Le Clerc edited a comment on Bug JENKINS-40712
[~imod] it seems that we have to release the Pipeline Maven Plugin ASAP with your PR, correct? cc [~alobato]

domi@fortysix.ch (JIRA)

unread,
Dec 29, 2016, 5:07:01 AM12/29/16
to jenkinsc...@googlegroups.com

Cyrille Le Clerc correct, I was in the thought that I have informed everyone as discussed in advance - sorry if it did not work out that way

m.vogel@first8.nl (JIRA)

unread,
Dec 29, 2016, 5:09:03 AM12/29/16
to jenkinsc...@googlegroups.com

I get bitten by this issues (quite hard, I just updated jenkins before merging pull requests in about 12 components of a project...).

Is there anything else we can do other than wait
Is there for instance any way to install locally-built plugins into jenkins so we can test upcoming versions of the pipelins plugin?

cleclerc@cloudbees.com (JIRA)

unread,
Dec 29, 2016, 5:10:01 AM12/29/16
to jenkinsc...@googlegroups.com
Cyrille Le Clerc assigned an issue to Alvaro Lobato
Change By: Cyrille Le Clerc
Assignee: Cyrille Le Clerc Alvaro Lobato

cleclerc@cloudbees.com (JIRA)

unread,
Dec 29, 2016, 5:15:01 AM12/29/16
to jenkinsc...@googlegroups.com

Hi,

Sorry for the inconvenience.

The fix for the withMaven(){...} Pipeline Maven Plugin is at https://github.com/imod/pipeline-maven-plugin/tree/JENKINS-39916_update_config-provider

I don't have write permission on the plugin repository (https://github.com/jenkinsci/pipeline-maven-plugin) and thus can not merge the branch to move forward (test, release a beta, release...). Maybe Alvaro Lobato can merge today but he is on holidays until monday.

cleclerc@cloudbees.com (JIRA)

unread,
Dec 29, 2016, 5:19:03 AM12/29/16
to jenkinsc...@googlegroups.com

Hi, I could get in touch with Alvaro Lobato, he is travelling today and he will be able to merge tonight (European Time).

domi@fortysix.ch (JIRA)

unread,
Dec 29, 2016, 5:21:01 AM12/29/16
to jenkinsc...@googlegroups.com

m.vogel@first8.nl (JIRA)

unread,
Dec 29, 2016, 5:40:01 AM12/29/16
to jenkinsc...@googlegroups.com

Thanks for that. I'm going to try the following work-around: keep the state of the config files we have in the configfile plugin somewhere else (it's only a few), revert the configfile plugin to 2.13, re-create the config files and see if that works

m.vogel@first8.nl (JIRA)

unread,
Dec 29, 2016, 5:57:01 AM12/29/16
to jenkinsc...@googlegroups.com

That did not work out. It runs into an exception when trying to add new files when the plugin has been reverted.

cleclerc@cloudbees.com (JIRA)

unread,
Dec 30, 2016, 6:09:01 AM12/30/16
to jenkinsc...@googlegroups.com

Hello Merijn Vogel and Kent Granström, I have successfully used the latest snapshot of the pipeline-maven-plugin (with PR https://github.com/jenkinsci/pipeline-maven-plugin/pull/10) with with config-file-provider:2.15.1.

Could you test please?

cleclerc@cloudbees.com (JIRA)

unread,
Dec 30, 2016, 6:10:01 AM12/30/16
to jenkinsc...@googlegroups.com
Cyrille Le Clerc edited a comment on Bug JENKINS-40712
Hello [~merijn_vogel] and [~kengra], I have successfully used the latest snapshot of the pipeline-maven-plugin ( with including PR https://github.com/jenkinsci/pipeline-maven-plugin/pull/10) with with config-file-provider:2.15.1.

Could you test please?

kent@clubsalino.com (JIRA)

unread,
Dec 31, 2016, 3:17:03 AM12/31/16
to jenkinsc...@googlegroups.com

Off work now. Will a go on måndag.
Hoppas new year to you all you guds doing suck a GREAT job

kent@clubsalino.com (JIRA)

unread,
Dec 31, 2016, 3:18:03 AM12/31/16
to jenkinsc...@googlegroups.com

Will have a go on Monday... Arrrgggh.... K9...

kent@clubsalino.com (JIRA)

unread,
Jan 2, 2017, 1:47:02 AM1/2/17
to jenkinsc...@googlegroups.com
Kent Granström edited a comment on Bug JENKINS-40712
Off work now. Will have a go on monday.
Happy new year to you all you guys doing such a GREAT job

kent@clubsalino.com (JIRA)

unread,
Jan 2, 2017, 1:47:02 AM1/2/17
to jenkinsc...@googlegroups.com
Kent Granström updated an issue
Change By: Kent Granström
Comment: Will have a go on Monday...  Arrrgggh....  K9...

kent@clubsalino.com (JIRA)

unread,
Jan 2, 2017, 1:47:02 AM1/2/17
to jenkinsc...@googlegroups.com
Kent Granström edited a comment on Bug JENKINS-40712
Off work now. Will a go on måndag monday .
Hoppas Happy new year to you all you guds guys doing suck such a GREAT job

kent@clubsalino.com (JIRA)

unread,
Jan 2, 2017, 2:51:02 AM1/2/17
to jenkinsc...@googlegroups.com

Have now set up an environment to be able to build the plugin. Once installed I could see a difference in the behaviour. First of all, the config files I have setup now appears in the "Snippet Generator" and it all looks good. However, when running the script it can't find 'mvn' any more. Despite one of the arguments being passed to 'withMaven(maven: 'maven333') ' for the maven version to use in Jenkins it can not find it anymore. I can see the workaround and just add the path to the $PATH and or manually set the $MAVEN_HOME but the question I ask myself is, why does it not find maven anymore? This is an excerpt from the log:

[Pipeline] }
[Pipeline] // stage
[Pipeline] withMaven
00:00:16.758 $ /bin/sh -c "which mvn"
[Pipeline] }
[Pipeline] // node
[Pipeline] }
[Pipeline] // timestamps
[Pipeline] End of Pipeline
ERROR: Could not find maven executable, please set up a Maven Installation or configure MAVEN_HOME environment variable
Finished: FAILURE

kent@clubsalino.com (JIRA)

unread,
Jan 2, 2017, 2:53:02 AM1/2/17
to jenkinsc...@googlegroups.com
Kent Granström updated an issue
Change By: Kent Granström
Comment:
Have now set up an environment to be able to build the plugin. Once installed I could see a difference in the behaviour. First of all, the config files I have setup now appears in the "Snippet Generator" and it all looks good. However, when running the script it can't find 'mvn' any more. Despite one of the arguments being passed to 'withMaven(maven: 'maven333') ' for the maven version to use in Jenkins it can not find it anymore. I can see the workaround and just add the path to the $PATH and or manually set the $MAVEN_HOME but the question I ask myself is, why does it not find maven anymore? This is an excerpt from the log:

{code:java}

[Pipeline] }
[Pipeline] // stage
[Pipeline] withMaven
00:00:16.758 $ /bin/sh -c "which mvn"
[Pipeline] }
[Pipeline] // node
[Pipeline] }
[Pipeline] // timestamps
[Pipeline] End of Pipeline
ERROR: Could not find maven executable, please set up a Maven Installation or configure MAVEN_HOME environment variable
Finished: FAILURE
{code}



kent@clubsalino.com (JIRA)

unread,
Jan 2, 2017, 2:55:02 AM1/2/17
to jenkinsc...@googlegroups.com

Have now set up an environment to be able to build the plugin. Once installed I could see a difference in the behaviour. First of all, the config files I have setup now appears in the "Snippet Generator" and it all looks good. However, when running the script it can't find 'mvn' any more. Despite one of the arguments being passed to 'withMaven(maven: 'maven333') ' for the maven version to use in Jenkins it can not find it anymore. I can see the workaround and just add the path to the $PATH and or manually set the $MAVEN_HOME but the question I ask myself is, why does it not find maven anymore? This is an excerpt from the log:

[Pipeline] }
[Pipeline] // stage
[Pipeline] withMaven
00:00:16.758 $ /bin/sh -c "which mvn"
[Pipeline] }
[Pipeline] // node
[Pipeline] }
[Pipeline] // timestamps
[Pipeline] End of Pipeline
ERROR: Could not find maven executable, please set up a Maven Installation or configure MAVEN_HOME environment variable
Finished: FAILURE

kent@clubsalino.com (JIRA)

unread,
Jan 2, 2017, 3:55:01 AM1/2/17
to jenkinsc...@googlegroups.com

Just to let you know the progress. Reverted back to 0.4 and had the same behaviour as before. Reinstalling the 0.5 version. Restarted the slave-machine. Restarted Jenkins on that slave and now it works???? For unknown reasons it now finds the installed maven...

cleclerc@cloudbees.com (JIRA)

unread,
Jan 2, 2017, 3:56:01 AM1/2/17
to jenkinsc...@googlegroups.com

Hello Kent Granström, I'm sorry for the problems, I'm upgrading one of our servers at the moment to try to reproduce.

Can you:

  • create a pipeline that looks like
    • withMaven(maven: 'maven333') {
         sh "mvn --version"    
      }
      
  • Enable the logs org.jenkinsci.plugins.pipeline.maven to ALL
  • Share with us the pipeline, the console output and the logs

kent@clubsalino.com (JIRA)

unread,
Jan 2, 2017, 4:21:02 AM1/2/17
to jenkinsc...@googlegroups.com

Guys, I can't reproduce this anymore. It works like charm....

m.vogel@first8.nl (JIRA)

unread,
Jan 2, 2017, 4:46:01 AM1/2/17
to jenkinsc...@googlegroups.com

I installed the 0.5-snapshot and the builds now work, thanks!

cleclerc@cloudbees.com (JIRA)

unread,
Jan 2, 2017, 4:59:01 PM1/2/17
to jenkinsc...@googlegroups.com

I have successfully migrated one of our integration server to org.jenkins-ci.plugins:config-file-provider:2.15.1 and to a org.jenkins-ci.plugins:pipeline-maven:0.5-SNAPSHOT based on https://github.com/jenkinsci/pipeline-maven-plugin/pull/16 .

dantran@gmail.com (JIRA)

unread,
Jan 2, 2017, 8:45:02 PM1/2/17
to jenkinsc...@googlegroups.com
dan tran commented on Bug JENKINS-40712

looking forward for 0.5 release. soon?

cleclerc@cloudbees.com (JIRA)

unread,
Jan 3, 2017, 8:33:02 AM1/3/17
to jenkinsc...@googlegroups.com

FYI Alvaro Lobato has kindly released a few hours ago while he is on holidays.

alobato@cloudbees.com (JIRA)

unread,
Jan 9, 2017, 4:10:02 AM1/9/17
to jenkinsc...@googlegroups.com
Alvaro Lobato closed an issue as Fixed
Change By: Alvaro Lobato
Status: Open Closed
Resolution: Fixed
Reply all
Reply to author
Forward
0 new messages