Let’s say I have dependency with a pom file in a repository like:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>mygroup</groupId>
<artifactId>myartifact</artifactId>
<version>1.0.0</version>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<scope>test</scope>
</dependency>
<dependencies>
</project>
What I’m looking for is to somehow create a new configuration and add the ‘mygroup:myartifact:1.0.0’ to the group in such a way that it will resolve the junit jar. Example build.gradle:
repositories {
...
}
configurations {
test
}
dependencies {
test 'mygroup:myartifact:1.0.0'
}
task dump << {
configurations.test.files.collect{ it.name}.sort().each { println it }
}
Is there a way to config this in such a way that ‘gradle dump’ will give me result: junit-4.8.2.jar myartifact-1.0.0.jar
Footnote: I’m using the name test for configuration for brevity, I expect it will clash with test task when applying java plugin.