简体   繁体   English

从 gradle api 插件中检索依赖 jar 文件

[英]retrieve dependency jar file from gradle api plugin

So I'm making a gradle plugin from java, and one of my goal is to add more dependencies from the content of a dependency所以我正在从 java 制作一个 gradle 插件,我的目标之一是从依赖项的内容中添加更多依赖项

for example in dependency A, And I know the dependency have dependency.json in the jar file.例如在依赖项 A 中,我知道依赖项在 jar 文件中有 dependency.json。 So I want to read the dependency.json and add dependencies based on the content of the file.所以我想读取dependency.json并根据文件的内容添加依赖项。 But how can I retrieve the jar of the dependency A?但是如何检索依​​赖项 A 的 jar 呢?

Thanks in advance!提前致谢!

Just figured out a way to retrieve jar.刚刚想出了一种方法来检索罐子。 Using configuration, add dependency to the configuration and use Configuration.files(Dependency...) works!使用配置,向配置添加依赖项并使用Configuration.files(Dependency...)工作!

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

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