Using maven plugin for v3 embedded glassfish
By sirajg on Dec 10, 2009
One of the ways the embedded feature could be used is through maven. A maven plugin exists specifically for embedded glassfish. It allows a simple way to use the various embedded features.
Following are the maven goals supported by the plugin :
embedded-glasfish:run - starts the embedded server if it is not already running and deploys the specfied application. The goal keeps the server running, so the user can make changes in the application, reploy and test iteratively.
embedded-glassfish:start - starts the embedded server with the specified parameters
embedded-glassfish:deploy - deploys the specified application
embedded-glassfish:undeploy - undeploys the application identified by the "name" parameter. If no name is specifed all applications are undeployed.
embedded-glassfish:stop - stops the embedded server
embedded-glassfish:admin - executes the specified admin command on the embedded server. For example, you could create a jdbc resource.
A sample pom.xml snippet that would execute the run goal :