all transitive dependencies this has are not in the ‘compile’ configuration. That’s because we set this:
configurations {
compile.transitive = false
}
But now I need Jersey’s transitive dependency on HK2 to be in the ‘compile’ configuration. (because it needs to be on the classpath while compiling and the Gradle IDEA plugin marks everything that is not ‘compile’ as ‘runtime’ and so in our IDE it doesn’t compile).
Now my workaround is this:
compile “org.glassfish.hk2:hk2-api:$HK2_VERSION”
By explicitly defining the dependency it is in ‘compile’. BUT now I need to specify the version of HK2 explicitly as well. But I don’t want to do that. I want the version that Jersey requires.
So I want to put the HK2 dependency in the ‘compile’ configuration without re-defining the complete dependency with its version.
That’s not something that’s currently supported. If you turn off transitive resolution, you need to fully specify any transitive dependencies yourself. Alternatively, you can leave transitive resolution on, and exclude selected transitive dependencies by group or module name.