Tuesday, August 30, 2011

use mvn from terminal to deploy your mvn based struts2 application

while use netbean 6.5 for iceface based application with glassfish2
I need test my newly created mvn based struts2 application,I don't want use jetty ot tomcat,because I already have a server startup,if I use gjetty/tomcat,I need to change the port,there might be some other port confict.search from internet get another mvn library to help run asadmin command to deploy my strut2 application from command line
here is the jar file need registered in pom and put correct parameter for it,then invoke "mvn exec:exec" then it will deploy you war file to existed start up server,this exec goal will call asadmin command to deploy war file.

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
<configuration>
<executable>/home/dttdev1/glassfish-2.1.1-ml/bin/asadmin
</executable>
<arguments>
<argument>deploy</argument>
<argument>--user=admin</argument>
<argument>--passwordfile=/home/dttdev1/.asadminpass
</argument>
<argument>--host=nppdev.rogers.com</argument>
<argument>--port=4848</argument>
<argument>target/${artifactId}.${packaging}</argument>
</arguments>
</configuration>
</plugin>

and remember to put this inside build/plugins

No comments:

Post a Comment