Closed xtracoder closed 8 years ago
@xtracoder, hmm, I don't know why they put that into the docs, you can actually check that it works not only for transient dependencies.
On 20 December 2015 at 21:18, xtracoder notifications@github.com wrote:
After digging deeper into problem here ( https://githubcom/bndtools/bnd/issues/1276) I've found that problem partially comes from this gradle-bundle-plugin - implementation actually sends all transitive dependencies to Bnd, not the ones explicitly defined in build configuration This, of course, has no sense for building of the bundle Such behavior occurs at least with Gradle 29
static File[] getClasspath(Jar jarTask) { def project = jarTaskproject def configuration = projectconfigurationsruntimecopyRecursive() def excludeDependencies = projectbundleexcludeDependencies excludeDependencieseach { configurationexclude(it) } configurationfiles }
more appropriate implementation is as of now
static File[] getClasspath(Jar jarTask) { def project = jarTaskproject def configuration = projectconfigurationsruntimecopyRecursive() def excludeDependencies = projectbundleexcludeDependencies def classPath = [] projectconfigurationsruntimeresolvedConfigurationfirstLevelModuleDependencieseach { dependency -> dependencymoduleArtifactseach { artifact -> classPath << artifactfile } } classPath }
Additionally, doc/readme says
Exclusion of dependencies from the classpath passed to Bnd bundle { exclude module: 'guava' exclude group: 'orgjmock' }
according to Gradle's docs ( https://docsgradleorg/current/javadoc/org/gradle/api/artifacts/Configurationhtml#exclude(javautilMap) ) this works only for transient dependencies and does not work for dependencies defined in 'compile' or 'runtime' configuratons
— Reply to this email directly or view it on GitHub https://github.com/TomDmitriev/gradle-bundle-plugin/issues/43.
Yours sincerely, Artyom Dmitriev
Re: you can actually check that it works not only for transient dependencies.
Yes, it does work. Most probably i've made a 'typo' or so when experimenting and it was not excluded in my test.
After digging deeper into problem here (https://github.com/bndtools/bnd/issues/1276) I've found that problem partially comes from this gradle-bundle-plugin - implementation actually sends all transitive dependencies to Bnd, not the ones explicitly defined in build configuration. This, of course, has no sense for building of the bundle. Such behavior occurs at least with Gradle 2.9.
more appropriate implementation is as of now
Additionally, doc/readme says
according to Gradle's docs ( https://docs.gradle.org/current/javadoc/org/gradle/api/artifacts/Configuration.html#exclude(java.util.Map) ) this works only for transient dependencies and does not work for dependencies defined in 'compile' or 'runtime' configuratons.