How to change maven build directory?

后端 未结 2 2038
轮回少年
轮回少年 2020-12-17 09:33

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?

相关标签:
2条回答
  • 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>
    
    0 讨论(0)
  • 2020-12-17 09:57
    <project>
      <build>
        <outputDirectory>target/classes</outputDirectory>
      </build>
    </project>
    
    0 讨论(0)
提交回复
热议问题