I’m having trouble setting up a provided configuration for an Eclipse project.
In this abbreviated example I have a multi-project build, where SubProjectB creates a WAR file and depends on SubProjectA (jar).
SubProjectA has a ‘provided’ dependency used only to compile, but this dependency somehow ends up in the deployment assembly of SubProjectB.
How can I prevent this?
SubProjectA
apply plugin: 'java'
apply plugin: 'eclipse-wtp'
configurations {
provided
}
dependencies {
provided "<DependencyA>" //compile-time dependency not to be in deployment assembly
}
sourceSets.main.compileClasspath += configurations.provided
eclipse.classpath.plusConfigurations += configurations.provided
SubProjectB:
apply plugin: 'java'
apply plugin: 'eclipse-wtp'
apply plugin: 'war'
dependencies {
compile project(':SubProjectA')
}
Edit: I found a thread from the old forum with the same issue: Provided dependencies are deployed in server via Eclipse
He discovers that if the provided dependencies are declared in the war project, the don’t get exported, but they do if they are declared in the jar project. Is there a way to include the dependencies in the provided scope of the jar project, and not export them in the war project?