Looking for a JavaEE Architect or Potential Tech Co-Founder?
Please don't hesitate to contact me.

Deploy a j2ee ear in glassfish using maven

The ff code will explain how a j2ee ear project can be deploy by invoking a maven goal.

The plugin: http://maven-glassfish-plugin.java.net/deploy-mojo.html

To deploy to a glassfish server using maven, invoke (inside your ear project):
mvn glassfish:deploy

You need to add the ff plugin to your ear's pom.xml

Take note that the plugin reads a password file that can be save anywhere you want as long as you have access to it. I've placed mine inside the glassfish's home directory for easier reference. It contains the glassfish's admin password. If you forgot to set this you'll get authentication error.

Also by default glassfish:deploy goal is calling asadmin, so it works perfectly on linux but not on windows. To be able to do so simply delete or rename asadmin to asadmin.sh. This way the plugin will read asadmin.bat for windows.
Deploy a j2ee ear in glassfish using maven Deploy a j2ee ear in glassfish using maven Reviewed by Edward Legaspi on Saturday, June 02, 2012 Rating: 5

No comments:

Powered by Blogger.