Skip to content

Commit cdffff3

Browse files
committed
Use glassfish.version instead of glassfishVersion
1 parent 140cfa4 commit cdffff3

File tree

6 files changed

+108
-5
lines changed

6 files changed

+108
-5
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ A Maven plugin for managing Embedded GlassFish server instances during the build
77
Run your project's main artifact on Embedded GlassFish directly from command line without modifying your `pom.xml`:
88

99
```bash
10-
mvn org.glassfish.embedded:embedded-glassfish-maven-plugin:7.1-SNAPSHOT:run -DglassfishVersion=7.0.25
10+
mvn org.glassfish.embedded:embedded-glassfish-maven-plugin:7.1-SNAPSHOT:run -Dglassfish.version=7.0.25
1111
```
1212

1313
Or add the plugin to your `pom.xml`:
@@ -18,7 +18,7 @@ Or add the plugin to your `pom.xml`:
1818
<artifactId>embedded-glassfish-maven-plugin</artifactId>
1919
<version>7.1-SNAPSHOT</version>
2020
<configuration>
21-
<glassfishVersion>7.0.25</glassfishVersion>
21+
<glassfish.version>7.0.25</glassfish.version>
2222
</configuration>
2323
</plugin>
2424
```
@@ -154,7 +154,7 @@ mvn embedded-glassfish:admin -Dcommands="set server.monitoring-service.module-mo
154154

155155
### Server Configuration
156156
- `configFile` - Custom domain configuration file
157-
- `glassfishVersion` - GlassFish version to use
157+
- `glassfish.version` - GlassFish version to use
158158
- `port` - HTTP port number (default: 8080)
159159
- `ports` - Map of port configurations
160160
- `serverID` - Server identifier (default: "maven")
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#
2+
# Copyright (c) 2022, 2023 Contributors to Eclipse Foundation. All rights reserved.
3+
#
4+
# This program and the accompanying materials are made available under the
5+
# terms of the Eclipse Public License v. 2.0, which is available at
6+
# http://www.eclipse.org/legal/epl-2.0.
7+
#
8+
# This Source Code may also be made available under the following Secondary
9+
# Licenses when the conditions for such availability set forth in the
10+
# Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11+
# version 2 with the GNU Classpath Exception, which is available at
12+
# https://www.gnu.org/software/classpath/license.html.
13+
#
14+
# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15+
#
16+
17+
invoker.goals=verify -Dglassfish.version=${tested.glassfish.version}
18+
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
4+
Copyright (c) 2022, 2023 Contributors to Eclipse Foundation. All rights reserved.
5+
6+
This program and the accompanying materials are made available under the
7+
terms of the Eclipse Public License v. 2.0, which is available at
8+
http://www.eclipse.org/legal/epl-2.0.
9+
10+
This Source Code may also be made available under the following Secondary
11+
Licenses when the conditions for such availability set forth in the
12+
Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
13+
version 2 with the GNU Classpath Exception, which is available at
14+
https://www.gnu.org/software/classpath/license.html.
15+
16+
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
17+
18+
-->
19+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
20+
<modelVersion>4.0.0</modelVersion>
21+
22+
<groupId>org.glassfish.embedded.embedded-glassfish-maven-plugin.its</groupId>
23+
<artifactId>start-with-gf-version</artifactId>
24+
<version>@project.version@</version>
25+
<packaging>pom</packaging>
26+
27+
<build>
28+
<plugins>
29+
<plugin>
30+
<groupId>org.glassfish.embedded</groupId>
31+
<artifactId>embedded-glassfish-maven-plugin</artifactId>
32+
<version>@project.version@</version>
33+
<executions>
34+
<execution>
35+
<id>pre-integration</id>
36+
<phase>pre-integration-test</phase>
37+
<goals>
38+
<goal>start</goal>
39+
</goals>
40+
<configuration>
41+
<port>8081</port>
42+
</configuration>
43+
</execution>
44+
<execution>
45+
<id>post-integration</id>
46+
<phase>post-integration-test</phase>
47+
<goals>
48+
<goal>stop</goal>
49+
</goals>
50+
</execution>
51+
</executions>
52+
</plugin>
53+
</plugins>
54+
</build>
55+
</project>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
Copyright (c) 2022, 2023 Contributors to Eclipse Foundation. All rights reserved.
3+
4+
This program and the accompanying materials are made available under the
5+
terms of the Eclipse Public License v. 2.0, which is available at
6+
http://www.eclipse.org/legal/epl-2.0.
7+
8+
This Source Code may also be made available under the following Secondary
9+
Licenses when the conditions for such availability set forth in the
10+
Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11+
version 2 with the GNU Classpath Exception, which is available at
12+
https://www.gnu.org/software/classpath/license.html.
13+
14+
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15+
*/
16+
17+
String [] buildLog = new File(basedir, 'build.log')
18+
19+
glassfishVersion = glassfishVersion.replace(".", "\\.")
20+
versionLines = buildLog.grep(~/^.*ClassPath Element.*glassfish-embedded-all-${glassfishVersion}\.jar.*$/)
21+
22+
assert versionLines.size() == 1: 'Configured message was expected in build log at INFO level'
23+
24+
startedLines = buildLog.grep(~/^INFO: Started GlassFish.*/)
25+
26+
assert startedLines.size() == 1: 'Expected messages about GlassFish started at INFO level'
27+
28+
true
29+

src/it/start-with-gf-version/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
</goals>
4040
<configuration>
4141
<port>8081</port>
42-
<glassfishVersion>@tested.glassfish.version@</glassfishVersion>
42+
<glassfish.version>@tested.glassfish.version@</glassfish.version>
4343
</configuration>
4444
</execution>
4545
<execution>

src/main/java/org/glassfish/maven/AbstractServerMojo.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,12 +231,13 @@ public abstract class AbstractServerMojo extends AbstractMojo {
231231
* @deprecated This is a deprecated and unused configuration. Likely to be removed in the next version of the plugin.
232232
*/
233233
@Parameter(property = "containerType", defaultValue = "all")
234+
@Deprecated
234235
protected String containerType;
235236

236237
/**
237238
* Version of Embedded GlassFish to download if Embedded GlassFish dependency is not provided
238239
*/
239-
@Parameter
240+
@Parameter(property = "glassfish.version", alias = "glassfish.version")
240241
protected String glassfishVersion;
241242

242243
/*===============================================

0 commit comments

Comments
 (0)