Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-30548

Post build step not removed from generated Maven job


    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • job-dsl-plugin
    • None
    • core 1.609.3
      job-dsl-plugin 1.38
      maven-plugin 2.12

      Removing postBuildSteps block from a job-dsl script does not remove the post build step on the generated job. To reproduce, create a job-dsl seed job with this script:

      mavenJob('example') {
        goals 'clean install'
        postBuildSteps { maven { goals "sonar:sonar -Psonar" } }

      Remove postBuildSteps block and run job-dsl seed job again. Configuration page of generated job example will still contain the post build step.

      On disk config.xml of generated job doesn't have <postbuilders/> section anymore. Reloading generated job using a groovy script in system console doesn't help. Only restarting Jenkins works. That makes me think that the bug is in Maven plugin but not in JobDSL plugin. Something is wrong when reloading config.xml of generated job.

            daspilker Daniel Spilker
            ydubreuil Yoann Dubreuil
            1 Vote for this issue
            5 Start watching this issue