# Help in generating customized War

**URL:** <https://discuss.gradle.org/t/help-in-generating-customized-war/10842>\
**Category:** Help/Discuss\
**Created:** [July 28, 2015, 5:40pm UTC](https://discuss.gradle.org/t/help-in-generating-customized-war/10842 "2015-07-28T17:40:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![unnijboss](https://avatars.discourse-cdn.com/v4/letter/u/e36b37/32.png) [@unnijboss](https://discuss.gradle.org/u/unnijboss)\
**Post date:** [July 28, 2015, 5:40pm UTC](https://discuss.gradle.org/t/help-in-generating-customized-war/10842/1 "2015-07-28T17:40:36Z")

</div>

Experts,

I am new to Gradle.  
I have a multi module project with Gradle. The structure can be illustrated as

A  
src  
----- build.gradle  
B  
src  
— main  
—webapp  
— myjars  
— test.jnlp

------ build.gradle  
build.gradle

My goal is to include the generated jar out of module A into ‘myjars’ folder of module ‘B’ during the ‘war’ construction.

Tried the following with no luck as this is getting executed before the jar creation of ‘A’

war {  
from(’…/A/build/libs’) {  
include '\*.jar’  
into ‘myJars’  
}  
}

Any advise?

---

<div class="post-metadata">

**Author:** ![jjustinic](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/jjustinic/32/9005_2.png) [@jjustinic](https://discuss.gradle.org/u/jjustinic)\
**Post date:** [July 29, 2015, 10:29pm UTC](https://discuss.gradle.org/t/help-in-generating-customized-war/10842/2 "2015-07-29T22:29:42Z")

</div>

Currently you are using the relative file path to where the built jar will end up.

```
from('../A/build/libs')

```

Instead you can reference jar on project A:

```
from(project(':A').jar)

```

Referencing it in this way causes the output of the jar task to be used and also creates a task dependency so that the jar file built in module A will be built before trying to include it in the war.
