Search code examples
javamavenjbossautomated-deploy

Auto-deploy a war file on local JBoss instance after package phase with Maven


When I build my project, I run this command :

mvn clean package

I'd like the resulting jar file built in the default target directory, during the package phase, be copied in another directory.

How can I do this with Maven?


Solution

  • By default the folder declared in Super POM, that have been inherited by your pom.

     <build>
    
     <directory>${project.basedir}/target</directory> 
    
    </build>
    

    You can change it in your pom.xml the next way:

     <build>
     <directory>${project.basedir}/yourFolder</directory>
    
    </build>