Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to copy .war file to another directory with maven?

I need copy the .war file that I build from target directory to deploy directory. I know how to do it with Ant but in this project use Maven and I dont know how to make it.

Thanks for your answers!

like image 549
emilioxiri Avatar asked Oct 25 '25 23:10

emilioxiri


1 Answers

In the War plugin configuration, you will need to give the plugin an output directory. ex:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-war-plugin</artifactId>
    <version>2.3</version>
    <configuration>
        <warName>[the name you want for your war file]</warName>
        <outputDirectory>[the output directory you want the war in]       </outputDirectory>
    </configuration>
</plugin>

Just replace the brackets and text with what you want

like image 192
John Avatar answered Oct 29 '25 00:10

John



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!