I have the following build.gradle
apply plugin: 'groovy'
apply plugin: 'idea'
apply plugin: 'java'
repositories {
mavenCentral()
maven {
url 'https://repo.jenkins-ci.org/releases'
}
maven {
url 'https://repo.jenkins-ci.org/public'
}
}
sourceSets {
main {
groovy {
srcDirs = ['src']
}
}
test {
groovy {
srcDirs = ['test']
}
}
}
dependencies {
compile group: 'org.jenkins-ci.main', name: 'jenkins-core', version: '2.76'
compile group: 'org.jenkins-ci.plugins.workflow', name: 'workflow-step-api', version: '2.13'
compile 'com.cloudbees:groovy-cps:1.14'
compile 'org.connectbot.jbcrypt:jbcrypt:1.0.0'
compileOnly 'javax.servlet:javax.servlet-api:3.1.0'
compile 'org.codehaus.groovy:groovy-all:2.4.12'
testCompile 'junit:junit:4.12'
}
When I run "gradle build" I get the following error:
> Task :compileGroovy FAILED
startup failed:
/home/user/myproject/SomeClass.groovy: 26: unable to resolve class org.jenkinsci.plugins.workflow.steps.FlowInterruptedException
@ line 26, column 11.
} catch (org.jenkinsci.plugins.workflow.steps.FlowInterruptedException flowInterruptedException) {
^
1 error
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileGroovy'.
> 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.
* Get more help at https://help.gradle.org
BUILD FAILED in 1s
1 actionable task: 1 executed
It's as if it does not see "org.jenkinsci.plugins.workflow.steps.FlowInterruptedException" but I added workflow-step-api and it should find it.
What am I doing wrong? How to fix?
Thank you