title: How to build a WAR file with gradle?
body: <p>I want to build a WAR file (and then deploy it to Tomcat). So, as an exercise, I've started a new Spring Boot Project using Gradle in IDEA IntelliJ. Afterwards, I've apply the plugin in the <code>build.gradle</code> file, like this <code>apply plugin: 'war'</code>
  . </p>
  
  <p>The problem is that when I try to run <code>gradle war</code> in the terminal, I get no war file! The only thing that happens is that it will generate a <code>\build</code> with 3 subsolders <code>classes</code>, <code>resources</code> and <code>tmp</code>, but there's no WAR in these.</p>
  
  <p>What should I do to get a WAR file? I've watched <a href="https://www.youtube.com/watch?v=05EKZ9Xmfws" rel="noreferrer">this</a> video, but this guy uses Maven and doesn't do advanced stuff and gets the war. I think there's got to be a way to keep it simple.</p>
  
  <p>When I run <code>gradle war --info</code></p>
  
  <blockquote>
  <pre><code>Initialized native services in: C:\Users\...\.gradle\native The client 
  </code></pre>
    
    <p>...</p>
    
    <p>Task :compileJava UP-TO-DATE
    Resolving global dependency management for project 'deleteme'
    Excluding [org.apache.tomcat:tomcat-annotations-api]
    Excluding []
    Skipping task ':compileJava' as it is up-to-date.
    :compileJava (Thread[Task worker for ':',5,main]) completed. Took 0.753 secs.
    :processResources (Thread[Task worker for ':',5,main]) started.</p>
    
    <p>Task :processResources UP-TO-DATE
    Skipping task ':processResources' as it is up-to-date.
    :processResources (Thread[Task worker for ':',5,main]) completed. Took 0.003 secs.
    :classes (Thread[Task worker for ':',5,main]) started.</p>
    
    <p>Task :classes UP-TO-DATE
    Skipping task ':classes' as it has no actions.
    :classes (Thread[Task worker for ':',5,main]) completed. Took 0.0 secs.
    :war (Thread[Task worker for ':',5,main]) started.</p>
    
    <p>Task :war SKIPPED
    Skipping task ':war' as task onlyIf is false.
    :war (Thread[Task worker for ':',5,main]) completed. Took 0.0 secs.</p>
  </blockquote>