I have a gradle project with the following dependency structure:
root
+
| \
| \
\
+
+
\
\
Basically module2eliminates the dependency some:transitive:2.1(which is transitive for module1). This is because it conflicts at runtime with other:transitive:1.1(I can provide the exact libraries that I'm talking about, but this is not relevant to my question), and the group id and artifact id are different, so you must manually exclude it:
configurations.all {
exclude group: 'some', module: 'transitive', version: '2.1'
}
( , dependencyInsight). module2, some:other:1.0, , gradle, :
gradle :module2:test -Dtest.single=SomeTest
IntelliJ 12 ( gradle), .ipr .iml gradle idea. .
, SomeTest IDE, , . IDE test, , ( ) :
-classpath ...:/path/to/jar/some/transitive/2.1/some-transitive-2.1.jar:...
, : IntelliJ , ?
Just for completeness, here is the conflict I am talking about (although this is not relevant to this discussion):
java.lang.IncompatibleClassChangeError: Implementing class
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at org.glassfish.jersey.server.ResourceConfig.scanClasses(ResourceConfig.java:875)
at org.glassfish.jersey.server.ResourceConfig._getClasses(ResourceConfig.java:840)
at org.glassfish.jersey.server.ResourceConfig.getClasses(ResourceConfig.java:755)
at org.glassfish.jersey.server.ResourceConfig$RuntimeConfig.<init>(ResourceConfig.java:1171)
at org.glassfish.jersey.server.ResourceConfig$RuntimeConfig.<init>(ResourceConfig.java:1144)
at org.glassfish.jersey.server.ResourceConfig.createRuntimeConfig(ResourceConfig.java:1140)
at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:299)
at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:272)
at org.glassfish.jersey.test.JerseyTest.<init>(JerseyTest.java:142)
at com.mypackage.rest.SomeTest.<init>(RestServiceTest.java:19)
which is caused by the incompatibility between Jersey and ASM 4.1 (Jersey uses 3.3.1, which has a different group identifier), which is a transitive dependency derived from another module.
By the way, I know that IDEA 13 has much better gradle integration, but (a) we have a license for 12 and will not update the entire development team in the near future, and (b) IDEA 13 still has some problems with polyglot projects gradle (Java / Scala), so it will not put an account.