Can't add unsupported SCM

133 views
Skip to first unread message

Bernard Bonn

unread,
May 28, 2014, 4:53:52 PM5/28/14
to job-dsl...@googlegroups.com, bb...@paychex.com
Hi,

We use a couple of SCM tools that are unsupported in job-dsl plugin (IBM RTC and Clear Case).  I was trying to add via the config block but was not getting what I wanted.   Really new to this plugin, so would appreciate any pointers.  Thanks!

I need the config.xml to look like this:
<scm class="com.ibm.team.build.internal.hjplugin.RTCScm" plugin="teamc...@1.0.11">
    <overrideGlobal>true</overrideGlobal>
    <buildTool>RTC Build Toolkit 4.0.4</buildTool>
    <serverURI>https://someurl:9443/ccm</serverURI>
    <timeout>480</timeout>
    <userId>******************</userId>
    <password>******************************************</password>
    <passwordFile></passwordFile>
    <buildType>buildDefinition</buildType>
    <buildDefinition>EntServiceBtpsRpsTaxPayRTC</buildDefinition>
    <browser>
    </browser>
  </scm>

I try a configure block like this:

configure{ project ->
                  
    project / scm / 'com.ibm.team.build.internal.hjplugin.RTCScm' {
    overrideGlobal ''
    buildTool ''
    serverURI 'https://someurl:9443/ccm'
    timeout '480'
    userId '***************'
    password '********************************************'
    passwordFile ''
    buildType 'buildDefinition'
    buildDefinition 'EntServiceBtpsRpsTaxPayRTC'
    }
  }

The scm section result is:

<scm class="hudson.scm.NullSCM"/>

Matt Sheehan

unread,
May 28, 2014, 5:29:04 PM5/28/14
to job-dsl...@googlegroups.com
Try:

configure{ project ->
    project / scm('class': 'com.ibm.team.build.internal.hjplugin.RTCScm') {

--
You received this message because you are subscribed to the Google Groups "job-dsl-plugin" group.
To unsubscribe from this group and stop receiving emails from it, send an email to job-dsl-plugi...@googlegroups.com.
To post to this group, send email to job-dsl...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/job-dsl-plugin/875f04d5-b05d-4b3e-a2f9-ae4c31d3cb2e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Bernard Bonn

unread,
May 29, 2014, 10:43:46 AM5/29/14
to job-dsl...@googlegroups.com
Thanks Matt!  When I try that code I get another exception:

hudson.util.IOException2: Unable to read N:\Jenkins\jobs\BB_DSL-Test\config.xml
at hudson.XmlFile.read(XmlFile.java:145)
at hudson.model.Items.load(Items.java:220)
at hudson.model.ItemGroupMixIn.createProjectFromXML(ItemGroupMixIn.java:234)
at jenkins.model.Jenkins.createProjectFromXML(Jenkins.java:2920)
at javaposse.jobdsl.plugin.JenkinsJobManagement.createNewItem(JenkinsJobManagement.java:261)
at javaposse.jobdsl.plugin.JenkinsJobManagement.createOrUpdateConfig(JenkinsJobManagement.java:107)
at javaposse.jobdsl.dsl.DslScriptLoader.extractGeneratedJobs(DslScriptLoader.java:115)
at javaposse.jobdsl.dsl.DslScriptLoader.runDslEngine(DslScriptLoader.java:97)
at javaposse.jobdsl.plugin.ExecuteDslScripts.perform(ExecuteDslScripts.java:159)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:785)
at hudson.model.Build$BuildExecution.build(Build.java:199)
at hudson.model.Build$BuildExecution.doRun(Build.java:160)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:566)
at hudson.model.Run.execute(Run.java:1665)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:246)
Caused by: hudson.util.RobustReflectionConverter$DuplicateFieldException: scm
---- Debugging information ----
duplicate-field     : scm
class               : hudson.model.FreeStyleProject
required-type       : hudson.model.FreeStyleProject
converter-type      : hudson.util.RobustReflectionConverter
path                : /project/scm[2]
line number         : 33
version             : not available

Bernard Bonn

unread,
May 29, 2014, 10:52:11 AM5/29/14
to job-dsl...@googlegroups.com
additional info:  I just created a freestyle project and noticed that <scm class="hudson.scm.NullSCM"/> is in the config.xml which would explain the duplicate error.  Do you know how to remove that or overwrite using the config block?  Thanks for any help you can give.

Matt Sheehan

unread,
May 29, 2014, 1:21:56 PM5/29/14
to job-dsl...@googlegroups.com
Oh yeah. You should be able to update the existing node like this:

job {
  configure{ project ->         
    Node scmNode = project / scm   
    scmNode.attributes().put 'class', 'com.ibm.team.build.internal.hjplugin.RTCScm'
    scmNode << {

Bernard Bonn

unread,
May 30, 2014, 10:28:01 AM5/30/14
to job-dsl...@googlegroups.com
Thanks Matt!  That did the trick, I really appreciate your help!!
Reply all
Reply to author
Forward
0 new messages