简体   繁体   English

从Maven本地下载人工制品的人工制品

[英]Locally downloading arifacts from Maven for Artifactory

I'm currently investigating ways to use Gradle and Artifactory efficiently for my company. 我目前正在研究为公司有效使用Gradle和Artifactory的方法。 I was able to build a few small test programs depending on each other and junit for testing. 我能够根据彼此和用于测试的junit构建一些小的测试程序。
One of the things we want to achieve is to have the third party libraries we use on our local Server with Artifactory (so not a mirror from Maven). 我们要实现的目标之一是通过Artifactory在本地服务器上使用第三方库(因此不能使用Maven的镜像)。 And this is where some problems came up: junit could not function without hamcrest. 这就是出现一些问题的地方:如果没有hamcrest,junit将无法运行。
So my question is: 所以我的问题是:

Is there a simple way to download an artefact from Maven along with it's dependencies in one go to avoid waste of time and frustration at build time? 是否有一种简单的方法可以一次性从Maven下载工件以及其依赖项,以避免浪费时间和在构建时感到沮丧?

The answer is: You don't need to. 答案是:您不需要。 Artifactory has the notion of remote repositories, which proxy repositories like maven central and jcenter, providing you with transparent dependencies (and transitive dependencies) resolution. Artifactory具有远程存储库的概念,该存储库代理了诸如Maven Central和Jcenter之类的存储库,为您提供了透明的依赖关系(以及可传递的依赖关系)解析。

Here is a simple example of a project which has Gradle build that works with Artifactory (using Artifactory Gradle plugin). 这是一个具有Gradle构建的项目的简单示例 ,该项目可与Artifactory一起使用(使用Artifactory Gradle插件)。 Feel free to copy-paste. 随意复制粘贴。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM