# Put root resulting jar intro subproject war

**URL:** <https://discuss.gradle.org/t/put-root-resulting-jar-intro-subproject-war/3789>\
**Category:** Old Forum Archive\
**Created:** [November 22, 2013, 10:44pm UTC](https://discuss.gradle.org/t/put-root-resulting-jar-intro-subproject-war/3789 "2013-11-22T22:44:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lepionir](https://avatars.discourse-cdn.com/v4/letter/l/848f3c/32.png) [@Lepionir](https://discuss.gradle.org/u/Lepionir)\
**Post date:** [November 22, 2013, 10:44pm UTC](https://discuss.gradle.org/t/put-root-resulting-jar-intro-subproject-war/3789/1 "2013-11-22T22:44:00Z")

</div>

So - correctly I something like this build script.

```gradle
// Syntax for creating additional properties
ext {
    // List containing commons libs
    commons_libs = ["commons-fileupload:commons-fileupload:1.2",
            "commons-io:commons-io:1.2",
            "commons-logging:commons-logging:1.1.1",
            "commons-codec:commons-codec:1.4"
    ]
      httpcomponents_libs = ["org.apache.httpcomponents:httpclient-cache:4.1",
            "org.apache.httpcomponents:httpcore:4.1",
            "org.apache.httpcomponents:httpmime:4.1"
    ]
      tomcat_libs = ["org.apache.tomcat:tomcat-catalina:7.0.39",
            "org.apache.tomcat:tomcat-util:7.0.39",
            "org.apache.tomcat:tomcat-juli:7.0.39",
            "org.apache.tomcat:tomcat-api:7.0.39",
            "org.apache.tomcat:tomcat-annotations-api:7.0.39",
            "org.apache.tomcat:tomcat-servlet-api:7.0.39",
            "org.apache.tomcat:tomcat-coyote:7.0.39"]
  }
    // For all projects in global project.
allprojects {
    apply plugin: 'java'
    apply plugin: 'maven'
      version = '0.4'
          repositories {
        mavenCentral()
    }
      dependencies {
        compile commons_libs
           compile httpcomponents_libs
          compile "mysql:mysql-connector-java:5.1.+"
        compile "org.littleshoot:dnsjava:2.1.3"
          testCompile "junit:junit:4.11"
    }
}
  // This params are set only for erpscan-server project.
project(':our_root_project_that_we_cannot_touch') {
    apply plugin: 'war'
          // We have non maven project structure, so setting currect roots for each set.
    sourceSets.main.java.srcDirs = ['src', 'anotherSrc']
    sourceSets.test.java.srcDirs = []
          // Resources are not used.
    sourceSets.main.resources.srcDirs = []
    sourceSets.test.resources.srcDirs = []
      dependencies {
           providedCompile tomcat_libs
        providedCompile httpcomponents_libs
        providedCompile commons_libs
          providedCompile "mysql:mysql-connector-java:5.1.+"
        providedCompile "org.littleshoot:dnsjava:2.1.3"
             }
      war {
        from './web'
        archiveName 'ROOT.war'
    }
  }
  // We have non maven project structure, so setting currect roots for each set.
 sourceSets.main.java.srcDirs = ['src']
sourceSets.test.java.srcDirs = ['tests']
  // Resources are not used.
sourceSets.main.resources.srcDirs = []
sourceSets.test.resources.srcDirs = []
    // Defining check code
dependencies {
    compile project(':our_root_project_that_we_cannot_touch')
  }

```

I want to be able to put resulting root jar into “our\_root\_project\_that\_we\_cannot\_touch” subproject war. Can anybody help with this?

---

<div class="post-metadata">

**Author:** ![Peter\_Niederwieser](https://avatars.discourse-cdn.com/v4/letter/p/9f8e36/32.png) [@Peter\_Niederwieser](https://discuss.gradle.org/u/Peter_Niederwieser)\
**Post date:** [November 23, 2013, 6:31am UTC](https://discuss.gradle.org/t/put-root-resulting-jar-intro-subproject-war/3789/2 "2013-11-23T06:31:00Z")

</div>

That would be ‘dependencies { compile project(":") }’, but you cannot have a dependency in both ways.
