# Create a ear having war inside it in the same project

**URL:** <https://discuss.gradle.org/t/create-a-ear-having-war-inside-it-in-the-same-project/2783>\
**Category:** Old Forum Archive\
**Created:** [February 12, 2014, 9:53pm UTC](https://discuss.gradle.org/t/create-a-ear-having-war-inside-it-in-the-same-project/2783 "2014-02-12T21:53:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rahul\_Verma](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/rahul_verma/32/611_2.png) [@Rahul\_Verma](https://discuss.gradle.org/u/Rahul_Verma)\
**Post date:** [February 12, 2014, 9:53pm UTC](https://discuss.gradle.org/t/create-a-ear-having-war-inside-it-in-the-same-project/2783/1 "2014-02-12T21:53:00Z")

</div>

Hello, i have one build.gradle which is generating war inside Build-libs for the project. Structure of project is like pResource

|

-------Java Resource

|

----src/main -\> (all java inside it in diff package)

----src/test

build.gradle

build.gradle looks like,

apply plugin: ‘java’ apply plugin: ‘eclipse’ apply plugin: ‘war’

sourceCompatibility = 1.7 version = ‘1.0’ tomcat\_home=‘C:/apache-tomcat-6.0.37-windows-x64/apache-tomcat-6.0.37’ ext.projectJar = “C:/Users/r.kumar.verma/Desktop/referenceAppJar”

jar {

manifest {

attributes ‘Implementation-Title’: ‘Gradle Quickstart’, ‘Implementation-Version’: version

} }

sourceSets {

main {

java {

srcDir ‘src/main’

}

}

test {

java {

srcDir ‘src/test’

}

} }

repositories {

mavenCentral() }

dependencies {

compile group: ‘commons-collections’, name: ‘commons-collections’, version: ‘3.2’

testCompile group: ‘junit’, name: ‘junit’, version: ‘4.+’

providedCompile ‘javax.servlet:servlet-api:2.5’

runtime ‘javax.servlet:jstl:1.1.2’

compile fileTree(dir: ‘WebContent/WEB-INF/lib’, include: ‘\*.jar’)

// compile fileTree(dir: projectJar, include: ‘\*.jar’) }

test {

systemProperties ‘property’: ‘value’ }

uploadArchives {

repositories {

flatDir {

dirs ‘repos’

}

}

}

task deployToTomcat(type: Copy) {

from war

into “${tomcat\_home}/webapps”

println “Copy from ${war} into ${tomcat\_home}/webapps”

}

I tried adding plugin ear but the issue is coming.
