We are using the propdeps plugin for our builds and found out that it changed behaviour between 0.0.5 and 0.0.6, which breaks our expectations. We are doing work in the hadoop world, where you want the hadoop dependencies to be provided. hadoop compliant jars are typically build like this:
jar {
description = "Assembles a Hadoop ready jar file"
doFirst {
into( 'lib' ) {
from configurations.compile
}
}
}
Given the simple build.gradle below, it works as expected, since it will put the provided dependency only into provided scope and our jar will only contain the libs in compile scope.
buildscript {
repositories {
maven { url 'http://repo.spring.io/plugins-release' }
}
dependencies {
classpath 'org.springframework.build.gradle:propdeps-plugin:0.0.5'
}
}
apply plugin: 'java'
configure( allprojects ) {
apply plugin: 'propdeps'
apply plugin: 'propdeps-maven'
apply plugin: 'propdeps-idea'
apply plugin: 'propdeps-eclipse'
}
dependencies{
provided group: 'com.google.guava', name: 'guava', version: '17.0'
}
jar {
description = "Assembles a Hadoop ready jar file"
doFirst {
into( 'lib' ) {
from configurations.compile
}
}
}
gradle dependencies -q
------------------------------------------------------------
Root project
------------------------------------------------------------
archives - Configuration for archive artifacts.
No dependencies
compile - Compile classpath for source set 'main'.
No dependencies
default - Configuration for default artifacts.
No dependencies
optional
No dependencies
provided
\--- com.google.guava:guava:17.0
runtime - Runtime classpath for source set 'main'.
No dependencies
testCompile - Compile classpath for source set 'test'.
No dependencies
testRuntime - Runtime classpath for source set 'test'.
\--- com.google.guava:guava:17.0
Switching to 0.0.6 or 0.0.7 I get this:
gradle dependencies -q
------------------------------------------------------------
Root project
------------------------------------------------------------
archives - Configuration for archive artifacts.
No dependencies
compile - Compile classpath for source set 'main'.
\--- com.google.guava:guava:17.0
default - Configuration for default artifacts.
No dependencies
optional
No dependencies
provided
\--- com.google.guava:guava:17.0
runtime - Runtime classpath for source set 'main'.
\--- com.google.guava:guava:17.0
testCompile - Compile classpath for source set 'test'.
\--- com.google.guava:guava:17.0
testRuntime - Runtime classpath for source set 'test'.
\--- com.google.guava:guava:17.0
Since the provided jars are now in compile scope, the plugin breaks completely for our use case, since we are back to square one in having the provided jars in the hadoop jar.
Am I doing something wrong? Is there another way to do this?
This also holds us back of using gradle 2.0, since only 0.0.7 of the propdeps-plugin is compatible with that.