title: Configuring Maven to generate output outside the project directory
body: <p>Please help me I am new to Maven. I am trying to generate a target folder in different directory from the Maven project folder. According to my requirements, the generated war file should be placed in another folder like C:\naresh folder when I build my maven project.</p>
  
  <p>Here my code:</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;packaging&gt;war&lt;/packaging&gt;
     &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
     &lt;groupId&gt;com.test&lt;/groupId&gt;
     &lt;artifactId&gt;project&lt;/artifactId&gt;
     &lt;version&gt;1.0&lt;/version&gt;
  
     &lt;build&gt;
      &lt;directory&gt;${project.basedir}/target&lt;/directory&gt;
       &lt;outputDirectory&gt;C:\Software\${project.basedir}/target&lt;/outputDirectory&gt;
  
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
               &lt;configuration&gt;
                 &lt;warSourceDirectory&gt;WebContent&lt;/warSourceDirectory&gt;
               &lt;/configuration&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  
      &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>