0

I'm trying to generate what appears in my Jenkins Maven job under Advanced... as

Incremental build - only build changed modules

This is an XML node that's directly within <maven2-moduleset>.

I didn't find it in the API, so I thought I'd use configure, but I can't figure it out. From what I understand, this should work:

mavenJob('foo') {
  rootPOM('foo/pom.xml')
  goals('clean package')
  configure { node ->
    node {
      incrementalBuild('true')
    }
  }
}

However, I get an Exception:

groovy.lang.MissingMethodException: No signature of method: groovy.util.Node.call() is applicable for argument types: (Generator$_run_closure1_closure14_closure16) values: [Generator$_run_closure1_closure14_closure16@1f7d8eff]
Possible solutions: wait(), name(), value(), any(), wait(long), any(groovy.lang.Closure)

What am I doing wrong?

eerriicc
  • 1,124
  • 4
  • 17
  • 29

1 Answers1

1

In this case you must use the / operator in the configure block to create or update an element, see Transforming XML in the Job DSL wiki.

mavenJob('foo') {
  rootPOM('foo/pom.xml')
  goals('clean package')
  configure { node ->
    node / incrementalBuild(true)
  }
}
daspilker
  • 8,154
  • 1
  • 35
  • 49