Unless I understand the documentation incorrectly ( http://www.gradle.org/docs/current/userguide/userguide_single.html#sec:java_plugin_and_dependency_management ), the java plugin should automatically add an assembled jar to the archives configuration, and so then I should be able to reference it in an extended configuration like so:
configurations {
cucumberRuntime {
extendsFrom archives, testRuntime
}
}
However, this does not include any of the packaged artifacts, only the testRuntime class path, so either I’m doing it completely wrong, or something is broken.
Context: I’m trying to run an ant task against the built artifacts using cucumber-jvm, as an integration test Complete build.gradle file:
apply plugin: 'java'
apply plugin: 'groovy'
apply plugin: 'idea'
//build stuff
sourceCompatibility=1.6
targetCompatibility=1.6
/*task myJar(type: Jar)
artifacts {
archives myJar
}*/
configurations {
cucumberRuntime {
extendsFrom archives, testRuntime
}
}
task cucumber {
dependsOn assemble
doLast {
ant.java(
fork: true,
classname: "cucumber.cli.Main",
classpath: configurations.cucumberRuntime.asPath,
failOnError: true
) {
arg value:"-f"
arg value:"pretty"
arg value:"--glue"
arg value:"src/test/groovy"
arg value:"src/test/resources"
}
}
}
dependencies {
// Groovy library for groovy building!
groovy 'org.codehaus.groovy:groovy-all:2.0.0-beta-2'
testCompile 'junit:junit:4.10'
testCompile 'info.cukes:cucumber-junit:1.0.0.RC15'
testCompile 'info.cukes:cucumber-groovy:1.0.0.RC15'
}
repositories {
mavenCentral()
}