Search code examples
javamaven-pluginmaven-war-plugin

maven-war-plugin does not change .war default directory


I try to change default .war directory by using maven-war-plugin

<plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-war-plugin</artifactId>
      <version>3.2.2</version>
      <configuration>
        <warSourceDirectory>${project.basedir}/src</warSourceDirectory>
      </configuration>
</plugin>

But it does not work. In the sense of my .war creates in the defaul (target) directory. I tried to use , but with the same result. What am I do wrong?


Solution

  • You can use warSourceDirectory to configure additional directories to be packaged into the WAR file.


    The outputDirectory property should do what you want to achieve:

    The directory for the generated WAR.