heremaps/gradle-jenkins-jobdsl-plugin

Compilation of jobdsl groovy file fails but Build gets successful

rgaduput opened this issue · 3 comments

Hi,
Running compilation of example of the project to see how it can fit my requirement.
I have changed the syntax of the sampleJob.groovy and ran the build.
It shows compilation error during the build but at the end Build gets successful. Why is that so ?

:example:clean
:example:compileJava NO-SOURCE
:example:compileGroovy
:example:processResources
:example:classes
:example:jar
:example:assemble
:example:codenarcJobdsl
Compilation failed for [SourceFile[/tools/jenkins/heremaps/gradle-jenkins-jobdsl-plugin/example/src/jobdsl/simpleJob.groovy]].
The Cobertura XML file [null] is not accessible; skipping this rule
:example:codenarcMain
The Cobertura XML file [null] is not accessible; skipping this rule
:example:codenarcTest NO-SOURCE
:example:compileTestJava NO-SOURCE
:example:compileTestGroovy NO-SOURCE
:example:processTestResources NO-SOURCE
:example:testClasses UP-TO-DATE
:example:test NO-SOURCE
:example:check
:example:build
BUILD SUCCESSFUL

Hi @rgaduput,

this is probably a problem with the Codenarc configuration, it seems that Codenarc is just skipping files that it cannot compile.

Please note that the build task you have executed does not actually run Job DSL. To locally generate the config.xml files for the jobs from the example run:

./gradlew example:dslGenerateXml --server=localhost

This should also give a better error message about why the file cannot be compiled. If you cannot find the problem, please share the modified simpleJob.groovy so that I can have a look.

Hi @mnonnenmacher Thank you it worked perfectly with dslGenerateXml.
also gave the expected error messages.
Thanks for the great plugin :)

Thanks for reporting back, I'm glad the plugin is useful for you.