Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How Do I Pull Maven Test Jars Using Gradle?

Tags:

In maven I can specify a "type" for dependency resolution. I am trying to pull down a tests.jar. How can I do this using Gradle?

I have tried using the Gradle Dependency below, but this does not pull down test.jar.

testCompile(group: 'org.apache.hbase', name: 'hbase', version: '0.94.2', type: 'test-jar')

Maven Dependency:

<dependency>
    <groupId>org.apache.hbase</groupId>
    <artifactId>hbase</artifactId>
    <version>0.94.2</version>
    <type>test-jar</type>
    <scope>test</scope>
</dependency>

details: Gradle 1.7

I am trying to pull down "hbase-0.94.2-tests.jar" from Maven Central

like image 993
Mike Rylander Avatar asked Nov 26 '13 17:11

Mike Rylander


People also ask

Where are jars in Gradle project?

The Jar is created under the $project/build/libs/ folder.

How do I create a test report in Gradle?

How to generate a Test Report. Gradle generates a Test Report automatically when it runs the entire Test Suite. To do the same, run ./gradlew test (or gradlew. bat test from Windows), or run the test Gradle task from your IDE.

Does Gradle work with Maven?

Furthermore, Gradle is compatible with IVY Metadata, allowing you to define custom rules to specify a version for a dynamic dependency, and resolving version conflicts. These are not available on Maven.


1 Answers

Gradle doesn't have a direct equivalent of Maven's <type>, but classifier: 'tests' should work here (instead of type: ...).

like image 187
Peter Niederwieser Avatar answered Sep 19 '22 19:09

Peter Niederwieser