1

I'm trying to exclude few jars from the .classpath file which is generated by the gradle eclipse plugin. Though i do the following stuff in my build.gradle to exclude these jars, the classpath still contains these jar files.

configurations {
    eclipseExcludedDeps
}

dependencies {
    eclipseExcludedDeps group: "javax", name:"javaee-api", version: "${versions.javaee_api}"
    eclipseExcludedDeps group: "javax.xml.parsers", name:"jaxp-api", version: "${versions.jaxp_api}"
    eclipseExcludedDeps group: "xerces", name:"xmlParserAPIs", version: "${versions.xmlParserAPIs}"
}

eclipse {
    wtp {
        component {
            minusConfigurations << configurations.eclipseExcludedDeps
        }
    }
}

I have tried all the approaches mentioned in the gradle docs but none of the them works for me. I'm using gradle version 2.7. To create the classpath i run 'gradle eclipse' command. Can someone please help me on this.

pr0gramist
  • 8,305
  • 2
  • 36
  • 48
Hemanth
  • 11
  • 3

1 Answers1

0

I'm not a WTP user myself but I think you'll need to configure eclipse.classpath

eclipse {
   classpath {
       minusConfigurations += [ configurations.eclipseExcludedDeps ]
   }
}
lance-java
  • 25,497
  • 4
  • 59
  • 101
  • Thanks for your reply. I have tried this approach earlier but the classpath still includes those jars. I doubt if it has to do with the gradle version (2.7) im using. – Hemanth Sep 27 '16 at 15:31