Changes in the Maven Embedded GlassFish plugin


The plugin changed its Maven coordinates (a.k.a GAV) over time:

  •  version <= 3.1.1
    • available under org.glassfish:maven-glassfish-embedded-plugin
  • version >= 3.1.2
    • available under org.glassfish.embedded:maven-glassfish-embedded-plugin

The goal “glassfish-embedded:run” has changed its way of reading the deployment configuration in the latest version: 4.0.
Projects using previous versions of the plugin will stop working with this goal.

Here is an example of the “old behavior”:

1
2
3
4
5
6
7
8
9
10
11
12
<plugin>
<groupId>org.glassfish.embedded</groupId>
<artifactId>maven-embedded-glassfish-plugin</artifactId>
<version>3.1.2.2</version>
<configuration>
<app>target/${project.build.finalName}.war</app>
<contextRoot>/</contextRoot>
<goalPrefix>embedded-glassfish</goalPrefix>
<autoDelete>true</autoDelete>
<port>8080</port>
</configuration>
</plugin>

The new behavior is as follow:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<plugin>
<groupId>org.glassfish.embedded</groupId>
<artifactId>maven-embedded-glassfish-plugin</artifactId>
<version>4.0</version>
<configuration>
<goalPrefix>embedded-glassfish</goalPrefix>
<autoDelete>true</autoDelete>
<port>8080</port>
</configuration>
<executions>
<execution>
<goals>
<goal>deploy</goal>
</goals>
<configuration>
<app>target/${project.build.finalName}.war</app>
<contextRoot>/</contextRoot>
</configuration>
</execution>
</executions>
</plugin>

The new version looks for execution of the deploy goal and the associated configuration, when running the goal ‘run’.

Both would allow you to run the latest version of the glassfish-embedded jar, you’d only need to add it as a plugin dependency:

1
2
3
4
5
6
7
8
9
10
<plugin>
[...]
<dependencies>
<dependency>
<groupId>org.glassfish.main.extras</groupId>
<artifactId>glassfish-embedded-all</artifactId>
<version>4.0</version>
</dependency>
</dependencies>
</plugin>



Comments:

Anybody wants to suppress the binding phase. put &lt;phase&gt;none&lt;/phase&gt;.

Posted by guest on April 23, 2015 at 11:47 AM CEST #

I assume this is because you want to run the plugin from command line and not have it bound to the lifecycle ?

Posted by Romain on April 23, 2015 at 06:19 PM CEST #

Exactly! I used launch embedded-glassfish:run in a console and just hit the Enter to redeploy since launching embedded glassfish in every build phase takes some time.

Posted by Jin Kwon on April 24, 2015 at 04:53 AM CEST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Software Developer and GlassFish enthusiast working for Oracle Corp.

Search

Top Tags
Categories
Archives
« May 2015
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
31
      
Today