title: Jenkins package project out of his workspace
body: <p>I tried to build maven war projects with Jenkins.</p>
  
  <p>Jenkins pulls the code and builds the project. However, the build is not in the workspace, but rather in a folder with the project source. I think Jenkins takes the target folder from maven pom file and builds it. </p>
  
  <p>How can I tune Jenkins to make a build and deploy pipeline?</p>
  
  <p>In the deploy phase Jenkins cannot find war file.</p>
  
  <p>OS is windows, IDE - eclipse.</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
  &lt;groupId&gt;my.test.webapp&lt;/groupId&gt;
  &lt;artifactId&gt;webApp&lt;/artifactId&gt;
  &lt;version&gt;1.0.0&lt;/version&gt;
  &lt;packaging&gt;war&lt;/packaging&gt;
  
  &lt;name&gt;webApp&lt;/name&gt;
  
  &lt;properties&gt;
      &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
  &lt;/properties&gt;
  
  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.tomcat&lt;/groupId&gt;
          &lt;artifactId&gt;tomcat-servlet-api&lt;/artifactId&gt;
          &lt;version&gt;8.0.5&lt;/version&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  
  &lt;build&gt;
      &lt;sourceDirectory&gt;src&lt;/sourceDirectory&gt;
      &lt;directory&gt;${basedir}\target&lt;/directory&gt; &lt;!-- tried with this line and without --&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
              &lt;version&gt;3.1&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;source&gt;1.7&lt;/source&gt;
                  &lt;target&gt;1.7&lt;/target&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
          &lt;plugin&gt;
              &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.3&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;warSourceDirectory&gt;WebContent&lt;/warSourceDirectory&gt;
                  &lt;failOnMissingWebXml&gt;false&lt;/failOnMissingWebXml&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p></p>