如何使用Gradle拉Maven测试罐? [英] How Do I Pull Maven Test Jars Using Gradle?

查看:130
本文介绍了如何使用Gradle拉Maven测试罐?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在maven中,我可以为依赖关系解析指定一个type。我试图拉下一个 tests.jar 。我如何使用Gradle?

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?

我已经尝试过使用Gradle Dependency,但这不会下拉 test.jar

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>
    <groupId>org.apache.hbase</groupId>
    <artifactId>hbase</artifactId>
    <version>0.94.2</version>
    <type>test-jar</type>
    <scope>test</scope>
</dependency>

详细信息: Gradle 1.7

details: Gradle 1.7

我试图从 Maven Central

推荐答案

Gradle没有直接相当于Maven的< type> ,但 classifier:'tests'应该工作这里(而不是类型:... )。

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

这篇关于如何使用Gradle拉Maven测试罐?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆