title: Gradle - War task: how include into the .war file a specific file from a specific path
body: <p>I am working with a multi module project.</p>
  
  <p>The following is mandatory</p>
  
  <pre><code>apply plugin: 'war'
  
  project(':thymeleaf-02-web') {
  
      description 'Web (HTML, JS, CSS)'
  
      dependencies {
  
          exportedProjects.each{
              if("$it"!=":thymeleaf-02-web")
                  compile project("$it")
          }
  
      }
  
      webAppDirName = 'src/main/resources'
  
      war {
          version=''
          baseName = warBaseName
      }
  
  }
  </code></pre>
  
  <p>The value for  <code>webAppDirName</code>  with <code>src/main/resources</code> is totally mandatory, it is not the expected working about with the <code>WEB-INF</code> location, because I am working with <code>Thymeleaf</code>, otherwise many <code>@Test</code> methods fail, it about Testing <code>@Controller</code> about <code>Spring</code>.</p>
  
  <p>Now I have the mandatory case that I need for the web app the <code>web.xml</code> file to configure the <code>&lt;error-page&gt;</code>. It is located as usual within the <code>src/main/webapp/WEB-INF/</code> location, but when I create the <code>.war</code> file and it is deployed the <code>web.xml</code> never was taken in consideration and thus is not included.</p>
  
  <p>I have tried the following addition:</p>
  
  <pre><code>dependencies {
  
      compile fileTree(dir: "src/main/webapp/WEB-INF/", include: 'web.xml')
      runtime fileTree(dir: "src/main/webapp/WEB-INF/", include: 'web.xml')
  
  
      exportedProjects.each{
          if("$it"!=":thymeleaf-02-web")
              compile project("$it")
      }
  
  }
  </code></pre>
  
  <p>But nothing. For the moment I must copy/paste <em>manually</em> the <code>web.xml</code> file into the <em>deployed</em> <code>.war</code> file.</p>
  
  <p>Thus what is the correct configuration?</p>