如何使用神器来保护依赖性

时间:2021-10-11 07:32:39

I'm new to artifactory and have just uploaded a bunch of custom jars to one of my repos. I now want to declare what dependencies there are between these jars so that when using gradle and specifying A.jar as a dependency it will transitively resolve B.jar as a dependency of A.jar but I cant find anywhere to say that A.jar depends on B.jar.

我是神器新手,刚刚将一堆自定义罐子上传到我的一个仓库。我现在想要声明这些jar之间存在哪些依赖关系,以便在使用gradle并将A.jar指定为依赖关系时,它将传递性地解析B.jar作为A.jar的依赖关系,但我无法找到任何地方说A.jar取决于B.jar。

Please help TIA

请帮助TIA

1 个解决方案

#1


1  

To get transitive dependency resolution, you'll have to upload a dependency descriptor (POM for a Maven repository, ivy.xml for an Ivy repository) for each Jar.

要获得传递依赖项解析,您必须为每个Jar上传依赖关系描述符(Maven存储库的POM,Ivy存储库的ivy.xml)。

When you manually upload a Jar, Artifactory offers to generate a basic descriptor, which you can edit to fill in the dependency information.

当您手动上传Jar时,Artifactory会提供生成基本描述符的方法,您可以编辑该描述符以填充依赖关系信息。

When you build and publish a Jar with Gradle, Gradle will automatically generate and upload a descriptor containing dependency information according to the dependencies specified in the build script. If necessary, the generated descriptor can be further customized in the build script. See "8.6. Publishing artifacts" in the Gradle User Guide.

当您使用Gradle构建和发布Jar时,Gradle将根据构建脚本中指定的依赖关系自动生成并上载包含依赖关系信息的描述符。如有必要,可以在构建脚本中进一步自定义生成的描述符。请参阅Gradle用户指南中的“8.6。发布工件”。

#1


1  

To get transitive dependency resolution, you'll have to upload a dependency descriptor (POM for a Maven repository, ivy.xml for an Ivy repository) for each Jar.

要获得传递依赖项解析,您必须为每个Jar上传依赖关系描述符(Maven存储库的POM,Ivy存储库的ivy.xml)。

When you manually upload a Jar, Artifactory offers to generate a basic descriptor, which you can edit to fill in the dependency information.

当您手动上传Jar时,Artifactory会提供生成基本描述符的方法,您可以编辑该描述符以填充依赖关系信息。

When you build and publish a Jar with Gradle, Gradle will automatically generate and upload a descriptor containing dependency information according to the dependencies specified in the build script. If necessary, the generated descriptor can be further customized in the build script. See "8.6. Publishing artifacts" in the Gradle User Guide.

当您使用Gradle构建和发布Jar时,Gradle将根据构建脚本中指定的依赖关系自动生成并上载包含依赖关系信息的描述符。如有必要,可以在构建脚本中进一步自定义生成的描述符。请参阅Gradle用户指南中的“8.6。发布工件”。