我有一個編譯本地jar(A)的項目(B)。我需要排除jar(A)中的依賴關係,但構建jar時無法執行此操作。我可以建立我怎麼過想罐子,但我必須有它的依賴性,只有排除這些項目B.無法排除jar中的依賴關係
這是的build.gradle項目A的罐子:
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'application'
repositories {
mavenCentral()
}
jar {
baseName = 'test'
version = '0.1.0'
manifest {
attributes ("Main-Class": "Main")
}
}
dependencies {
compile("org.springframework.boot:spring-boot-starter-web:1.4.0.RELEASE") // I need this excluded later
compile("org.springframework.boot:spring-boot-starter-jetty:1.4.0.RELEASE") // I need this excluded later
/*
some other dependencies here
*/
}
這是的build.gradle項目B:
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'application'
repositories {
mavenCentral()
flatDir(dirs: "lib")
}
sourceCompatibility = 1.8
dependencies {
compile ':test:0.1.0' // this is the jar I need to exclude some things from
compile("org.springframework.boot:spring-boot-starter-web:1.4.0.RELEASE")
compile("org.springframework.boot:spring-boot-starter-jetty:1.4.0.RELEASE")
}
這似乎是使用普通的排除條款不起作用
compile (':test:0.1.0') {
exclude group: 'org.springframework.boot' // doesn't work
}
任何幫助將不勝感激。
該語法應該工作 - dependencyInsight說什麼? –
正在運行'dependencyInsight --configuration compile --dependency test'' 產生':dependencyInsight:test:0.1.0 \ --- compile' –
噢,我的意思是在它上面運行它。 '衝刺引導起動web'。 –