如何让sbt插件排除其依赖?

时间:2015-01-11 11:10:31

标签: dependencies sbt sbt-plugin

在对https://github.com/google/guice/issues/846超过一个小时的撞击之后,我意识到我有两个不同的罐子提供的Guice库:guice-4.0-beta5.jar和sisu-guice-3.1.3-no_aop。广口瓶中。

... Gaahh

第二个与Guava 18不兼容,如果加载,在使用Guava时会导致访问错误。

我正在创建一个没有依赖关系的SBT插件,sbtPlugin := true增加了隐私性的例外。

依赖树(我的插件是com.github.pauldraper.playclosure:sbt-plugin):

> what-depends-on org.sonatype.sisu sisu-guice 3.1.3
[info] org.sonatype.sisu:sisu-guice:3.1.3
[info]   +-org.eclipse.sisu:org.eclipse.sisu.plexus:0.0.0.M5
[info]     +-org.apache.maven:maven-core:3.2.2
[info]     | +-org.vafer:jdeb:1.3
[info]     |   +-com.typesafe.sbt:sbt-native-packager:0.7.4
[info]     |     +-com.typesafe.play:sbt-plugin:2.3.7
[info]     |       +-com.github.pauldraper.playclosure:sbt-plugin:0.0-SNAPSHOT
[info]     |       | +-default:project_2.10:0.1-SNAPSHOT [S]
[info]     |       | 
[info]     |       +-default:project_2.10:0.1-SNAPSHOT [S]
[info]     |       
[info]     +-org.apache.maven:maven-plugin-api:3.2.2
[info]       +-org.apache.maven:maven-core:3.2.2
[info]       | +-org.vafer:jdeb:1.3
[info]       |   +-com.typesafe.sbt:sbt-native-packager:0.7.4
[info]       |     +-com.typesafe.play:sbt-plugin:2.3.7
[info]       |       +-com.github.pauldraper.playclosure:sbt-plugin:0.0-SNAPSHOT
[info]       |       | +-default:project_2.10:0.1-SNAPSHOT [S]
[info]       |       | 
[info]       |       +-default:project_2.10:0.1-SNAPSHOT [S]
[info]       |       
[info]       +-org.vafer:jdeb:1.3
[info]         +-com.typesafe.sbt:sbt-native-packager:0.7.4
[info]           +-com.typesafe.play:sbt-plugin:2.3.7
[info]             +-com.github.pauldraper.playclosure:sbt-plugin:0.0-SNAPSHOT
[info]             | +-default:project_2.10:0.1-SNAPSHOT [S]
[info]             | 
[info]             +-default:project_2.10:0.1-SNAPSHOT [S]
[info]             

所以这种可怕的依赖性通过sbt-plugin传递。

理想情况下,我不必要求插件的最终用户使用排除。

如何使用我的插件以排除此依赖关系,并且不会产生此问题?

0 个答案:

没有答案