[英]How do I tell Gradle to include a local library jar that in turn has dependencies?
[英]Gradle - How to include a local library in the output jar
我的Gradle項目有幾個Maven依賴項。 我不要那些放在我的罐子里。 它還對本地jar有一些依賴性。 如何在輸出jar中包含這些類?
您可以使用以下內容引用本地存儲庫(在這種情況下為目錄):
repositories {
ivy {
// URL can refer to a local directory
url "../local-repo"
}
}
要從最終jar中排除依賴的jar,可以使用如下的編譯配置:
compileOnly files('libs/jgrapht-jdk1.6.jar')
compile 'org.simpleframework:simple-xml:2.7'
在這里可以看到更詳細的答案: Gradle依賴項本地jar文件
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.