plugins { id 'groovy' } repositories { maven { url 'https://repo.jenkins-ci.org/releases/' } maven { url 'https://repo.jenkins-ci.org/public/' } mavenCentral() } sourceSets { // Main sources are Jenkins Shared Library scripts loaded at runtime by JenkinsPipelineUnit. // They depend on Jenkins API and are not pre-compiled — loadScript() handles them at test time. main { groovy { srcDirs = [] } java { srcDirs = [] } } test { // test/unit — actual test classes // test/stubs — minimal stub implementations of Jenkins stage classes used by dispatch tests groovy { srcDirs = ['test/unit', 'test/stubs'] } } } dependencies { testImplementation 'com.lesfurets:jenkins-pipeline-unit:1.22' // Match the Groovy version bundled by JenkinsPipelineUnit testImplementation 'org.codehaus.groovy:groovy-all:2.4.21' testImplementation 'junit:junit:4.13.2' } test { systemProperty 'user.dir', rootDir.absolutePath testLogging { events 'passed', 'skipped', 'failed' exceptionFormat 'full' } }