When running a build without the clean task, the build may fail when running the compileJava task because the stubs generated from Groovy sources have not been regenerated by the stapler task.
:job-dsl-plugin:localizer UP-TO-DATE
:job-dsl-plugin:stapler UP-TO-DATE
:job-dsl-plugin:compileJava
Download http:warning: [options] bootstrap class path not set in conjunction with -source 1.6
warning: No SupportedSourceVersion annotation found on org.kohsuke.wpc.ProcessorImpl, returning RELEASE_6.
/scratch/jenkins/workspace/plugins/job-dsl-plugin/job-dsl-plugin/build/generated-src/stubs/javaposse/jobdsl/plugin/InterruptibleJobManagement.java:10: error: InterruptibleJobManagement is not abstract and does not override abstract method requireMinimumPluginVersion(String,String,boolean) in JobManagement
@groovy.transform.ThreadInterrupt() public class InterruptibleJobManagement
^
Note: /scratch/jenkins/workspace/plugins/job-dsl-plugin/job-dsl-plugin/build/generated-src/stubs/javaposse/jobdsl/plugin/InterruptibleJobManagement.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
2 warnings
:job-dsl-plugin:compileJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':job-dsl-plugin:compileJava'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 1 mins 38.38 secs
It's possible to run the build with clean, but that's only a workaround since it unnecessarily increases build time.