2015-01-17 60 views
2

是否可以排除嵌套的依賴關係?考慮以下依賴性:我可以排除嵌套的依賴關係嗎?

[info] +-org.apache.ws.commons.axiom:axiom-dom:1.2.13 
[info] | +-commons-logging:commons-logging:1.1.1 
[info] | +-org.apache.geronimo.specs:geronimo-activation_1.1_spec:1.1 
[info] | +-org.apache.geronimo.specs:geronimo-javamail_1.4_spec:1.7.1 
[info] | +-org.apache.ws.commons.axiom:axiom-api:1.2.13 
[info] | | +-commons-logging:commons-logging:1.1.1 
[info] | | +-jaxen:jaxen:1.1.3 
[info] | | +-org.apache.geronimo.specs:geronimo-activation_1.1_spec:1.1 
[info] | | +-org.apache.geronimo.specs:geronimo-javamail_1.4_spec:1.7.1 
[info] | | +-org.apache.geronimo.specs:geronimo-stax-api_1.0_spec:1.0.1 
[info] | | +-org.apache.james:apache-mime4j-core:0.7.2 

我想排除org.apache.geronimo.specs:geronimo-stax-api_1.0_spec

以下是我在build.scala

"org.apache.ws.commons.axiom" % "axiom-dom" % axiomVersion excludeAll ExclusionRule(organization = "org.apache.geronimo.specs", name = "geronimo-stax-api_1.0_spec"), 

沒有工作嘗試。我想另一種選擇是讓公理不敏感,但是它需要我手動指定所有剩餘的依賴關係,這是不冷靜的。

回答

0

根據SBT manual您必須將ExclusionRule包裝到排除功能中。就像這樣:

"org.apache.ws.commons.axiom" % "axiom-dom" % axiomVersion excludeAll(ExclusionRule(organization = "org.apache.geronimo.specs", name = "geronimo-stax-api_1.0_spec")) 

"org.apache.ws.commons.axiom" % "axiom-dom" % axiomVersion exclude("org.apache.geronimo.specs", "geronimo-stax-api_1.0_spec") 
+0

哦,我忘了,當我在寫我的問題類型。對不起。是的,我在'build.scala'中有。否則它根本不會編譯。 – expert