Reputation: 5193
I want that when I run the mvn install, a war can be generated in the /target and an other war in the c:....tomcat 6\deploy directory. I'm using maven2, Eclipse and m2eclipse. How to do this ?? Thnx :)
Upvotes: 1
Views: 415
Reputation: 49361
You could try to use the maven-antrun-plugin to copy your war to the tomcat deploy directory like this:
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<phase>install</phase>
<configuration>
<target>
<copy file="{project.build.directory}/${project.actifactId}-${project.version}.war" tofile="<your tomcat path>/${project.actifactId}-${project.version}.war" />
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
Upvotes: 1
Reputation: 12685
Try the cargo-maven2-plugin. Probably something like this would work:
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<executions>
<execution>
<id>deploy-local</id>
<phase>install</phase>
<goals>
<goal>deployer-deploy</goal>
<goals>
</execution>
</executions>
<configuration>
<container>
<containerId>tomcat6x</containerId>
</container>
<configuration>
<type>existing</type>
<home>/your/tomcat/dir</home> <!-- replace as needed -->
</configuration>
</configuration>
</plugin>
... slap that into a profile or the top-level <build><plugins>
section and see if it works for you ...
Upvotes: 1
Reputation: 13327
Maybe you don't need to copy the war file if you try the Maven Jetty Plugin. This plugin is for running a web application directly from Maven.
Upvotes: 1