# Possible to deploy war in exploded form without first creating the actual war?

**URL:** <https://discuss.gradle.org/t/possible-to-deploy-war-in-exploded-form-without-first-creating-the-actual-war/22937>\
**Category:** Help/Discuss\
**Created:** [June 12, 2017, 4:52pm UTC](https://discuss.gradle.org/t/possible-to-deploy-war-in-exploded-form-without-first-creating-the-actual-war/22937 "2017-06-12T16:52:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikesnare](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/mikesnare/32/5846_2.png) [@mikesnare](https://discuss.gradle.org/u/mikesnare)\
**Post date:** [June 12, 2017, 4:52pm UTC](https://discuss.gradle.org/t/possible-to-deploy-war-in-exploded-form-without-first-creating-the-actual-war/22937/1 "2017-06-12T16:52:02Z")

</div>

For reasons not worth mentioning (but legacy, of course) our webapp will not run as a war file. It must be exploded into the correct directory prior to launching tomcat. In order to achieve this I’m using the standard war plugin to create the war and then I’m exploding the contents of that war during the deploy phase using a copy task configured with a zipTree that wraps the war file.

This works, but is unfortunately one of the more time-consuming individual steps in the build. Is it possible to do what I’m doing but to avoid actually creating the war file? I.e. is there any way to use the configuration of that war as the input to a copy and get the results I’m looking for?

---

<div class="post-metadata">

**Author:** ![Rene](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/rene/32/8082_2.png) [@Rene](https://discuss.gradle.org/u/Rene)\
**Post date:** [June 13, 2017, 8:39am UTC](https://discuss.gradle.org/t/possible-to-deploy-war-in-exploded-form-without-first-creating-the-actual-war/22937/2 "2017-06-13T08:39:23Z")

</div>

Hey Mike,  
the `War` task implements [CopySpec](https://docs.gradle.org/current/javadoc/org/gradle/api/file/CopySpec.html) that can be used as input for other copy operations.

```
task explodedWar(type:Copy){
    with(war)
    into("$buildDir/explodedWar")
}
```

---

<div class="post-metadata">

**Author:** ![mikesnare](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/mikesnare/32/5846_2.png) [@mikesnare](https://discuss.gradle.org/u/mikesnare)\
**Post date:** [June 13, 2017, 12:48pm UTC](https://discuss.gradle.org/t/possible-to-deploy-war-in-exploded-form-without-first-creating-the-actual-war/22937/3 "2017-06-13T12:48:45Z")

</div>

That works perfectly. Thanks!
