2015-11-03 77 views
0

短暂的依赖在我的build.gradle我有以下剪断:gradle这个排除项目

dependencies { 
    compile project(':utils') 
    compile (project(':cache')) { 
     // excludings because of dropwizard conflicts 
     exclude group: 'org.glassfish.jersey.core' 
     exclude group: 'javax.ws.rs' 
     exclude group: 'com.codahale.metrics' 
    } 

但事实上文物,不排除我还是结了不同的球衣和指标在类路径。 Ony如果我把它放在我的缓存/ build.gradle它会编译和运行。

configurations { 
    all*.exclude group: 'com.codahale.metrics' 
    all*.exclude group: 'org.glassfish.jersey.core' 
} 

但是,然后我的缓存项目被打破,因为缺少依赖关系,这不是我想要的。

回答

0

我以前遇到过这个问题,有什么工作是当我包括module:与组明确。像这样:

exclude group: 'commons-math3', module: 'commons-math3' 

如果使用配置排除,你不必做所有的*,你可以做到这一点的只是本地项目的编译:

compile.exclude group: 'commons-math3', module: 'commons-math3' 
+0

有趣的是这部作品在gradle命令行方式,但我的intellij仍然无法排除依赖关系。我绝不会接受这个答案,但也会警告其他用户,这可能无法完全解决问题。 – KIC

+0

是你的intellij环境设置使用不同版本的gradle? – RaGe