Using maven plugin for v3 embedded glassfish

The final version of Glassfish V3 is now available for download. It contains an embedded API that allows users to to create a customized, integrated solution within a single JVM.

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 :


<plugins>
<plugin>
<groupId>org.glassfish</groupId>
<artifactId>maven-embedded-glassfish-plugin</artifactId>
<version>3.0</version>
<configuration>
<goalPrefix>glassfish</goalPrefix>
<app>test.war</app>
<port>8080</port>
<contextRoot>test</contextRoot>
</configuration>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>run</goal
</goals>
</execution>
</executions>
</plugin>
</plugins>

Comments:

Is the embedded version still a 3.0 Snapshot?

Posted by Arul on December 10, 2009 at 04:52 AM PST #

There is an error in your pom.xml. Missing > bracket.

<goal>run</goal

Posted by Tan-Vinh Nguyen on January 31, 2011 at 08:28 PM PST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

sirajg

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today