How to change maven build directory?

53,861

Solution 1

Sure. Update your POM with:

<build>
  <directory>my_new_build_path</directory>
</build>

Part 2: To specify the output path for a WAR:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-war-plugin</artifactId>
    <version>2.0</version>
    <configuration>
        <warName>test-web-app</warName>
        <outputDirectory>my_output_path</outputDirectory>
    </configuration>
</plugin>

Solution 2

<project>
  <build>
    <outputDirectory>target/classes</outputDirectory>
  </build>
</project>
Share:
53,861
user1285928
Author by

user1285928

Updated on July 21, 2020

Comments

  • user1285928
    user1285928 almost 4 years

    I have a maven project which I compile with Netbeans. I there a way to specify a different build directory where the compiled binary code is copied after compilation?