How to set exported property in .classpath file.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

How to set exported property in .classpath file.

This post has NOT been accepted by the mailing list yet.

I'm using Gradle 1.7 and having trouble to create eclipse .classpath file. Eclipse plugin for Gradle seems to set exported property to 'true' even if the library is testCompile group. As a result, junit and mockito library will be deployed to application server If I import the project to Eclipse.
I tried the following:

shouldExcluded = configurations.testCompile.dependencies.inject(new HashSet(), {s, v -> s + "$$$v.version"})

eclipse.classpath.file {
  beforeMerged { classpath ->
  whenMerged { cp ->
    cp.entries.findAll {
      (it instanceof or.gradle.plugins.ide.eclipse.model.Library) &&
    }*.exported = false

It can exclude libraries in testCompile group such as JUnit. But cannot excluded hamcrest library that is dependency of JUnit.

Can I set exported property to false for testCompile group libraries?