How to concatenate configurations?


(tulsoba) #1

I have the following:

apply plugin: 'war'
  configurations {
  myConf
}
  dependencies {
  myConf "org.apache.ws.xmlschema:xmlschema-core:2.0.2"
  myConf "asm:asm:3.3.1"
    providedCompile 'javax.servlet.jsp:jsp-api:2.0'
  providedCompile = configurations.providedCompile + configurations.myConf
  }

so I am trying to add the dependencies from myConf to the providedCompile scope. But the generated war still contains the two dependencies from myConf.

How do I concatenate the configuations?


(Peter Niederwieser) #2

You can do ‘dependencies { providedCompile myConf }’. See Dependencies to other configurations in the Gradle Build Language Reference.


(tulsoba) #3

If I do:

apply plugin: 'war'
  configurations {
  myConf
}
dependencies {
  myConf "org.apache.ws.xmlschema:xmlschema-core:2.0.2"
  myConf "asm:asm:3.3.1"
  providedCompile 'javax.servlet.jsp:jsp-api:2.0'
  providedCompile myConf
}

I get:

* What went wrong:
A problem occurred evaluating project ':MyProject'.
> No such property: myConf for class: org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler

(Peter Niederwieser) #4

It’s ‘configurations.myConf’.