Posted in Software Engineering, web application

Changing maven-war-plugin output directory

If you pack your project using maven war plugin, eg: using command: (
mvn war:war

The default output directory is:
./war

Sometimes we want to change the output directory to:
./src/main/webapp

Following are the pom.xml configuration examples:

 <plugins>
           
<plugin>
               
<groupId>org.apache.maven.plugins</groupId>
               
<artifactId>maven-war-plugin</artifactId>
               
<version>2.0</version>
               
<configuration>
                   
<warName>your-war-name</warName>
                   
<outputDirectory>src/main/webapp</outputDirectory>
               
</configuration>
           
</plugin>
       
</plugins>

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s