Gradle: declare compile time only dependencies with Java plugin #229

This commit is contained in:
Emux 2016-11-04 22:06:32 +02:00
parent e224a7cf5b
commit 885264ad8c

View File

@ -1,17 +1,14 @@
apply plugin: 'java' apply plugin: 'java'
apply plugin: 'maven' apply plugin: 'maven'
configurations { providedCompile }
dependencies { dependencies {
compile 'org.slf4j:slf4j-api:1.7.21' compile 'org.slf4j:slf4j-api:1.7.21'
providedCompile 'com.google.code.findbugs:annotations:2.0.1' compileOnly 'com.google.code.findbugs:jsr305:3.0.1'
} }
sourceSets { sourceSets {
main.java.srcDirs = ['src'] main.java.srcDirs = ['src']
main.resources.srcDirs = ['resources'] main.resources.srcDirs = ['resources']
main.compileClasspath += configurations.providedCompile
} }
if (project.hasProperty("SONATYPE_USERNAME")) { if (project.hasProperty("SONATYPE_USERNAME")) {