Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1395,7 +1395,7 @@
</manifest>
<manifestEntries>
<Bundle-SymbolicName>org.glassfish.embedded.static-shell</Bundle-SymbolicName>
<Class-Path>${classpath.derby} ../asadmin/server-mgmt.jar ../../admin-cli.jar</Class-Path>
<Class-Path>${classpath.derby} ../asadmin/server-mgmt.jar ../../admin-cli.jar ../bootstrap/simple-glassfish-api.jar ../bootstrap/glassfish-jdk-extensions.jar ../bootstrap/glassfish.jar ../bootstrap/glassfish-jul-extension.jar </Class-Path>
<Main-Class>org.glassfish.runnablejar.UberMain</Main-Class>
<Add-Opens>java.base/java.lang java.base/java.io java.base/java.util java.base/sun.nio.fs java.base/sun.net.www.protocol.jrt java.naming/javax.naming.spi java.rmi/sun.rmi.transport jdk.management/com.sun.management.internal java.base/jdk.internal.vm.annotation</Add-Opens>
<Add-Exports>java.naming/com.sun.jndi.ldap java.base/jdk.internal.vm.annotation</Add-Exports>
Expand Down
1 change: 1 addition & 0 deletions appserver/tests/embedded/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
<systemPropertyVariables>
<project.directory>${basedir}</project.directory>
<buildDir>${surefire.workdir}</buildDir>
<glassfish.version>${glassfish.version}</glassfish.version>
</systemPropertyVariables>
</configuration>
</plugin>
Expand Down
21 changes: 20 additions & 1 deletion appserver/tests/embedded/runnable/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@
<version>1.2.6</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.glassfish.main.distributions</groupId>
<artifactId>glassfish</artifactId>
<type>zip</type>
<version>${glassfish.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.main.extras</groupId>
<artifactId>glassfish-embedded-all</artifactId>
Expand All @@ -59,12 +65,25 @@
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies</id>
<id>copy-embedded</id>
<phase>generate-test-resources</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<includeGroupIds>org.glassfish.main.extras</includeGroupIds>
<outputDirectory>${surefire.workdir}</outputDirectory>
<stripVersion>true</stripVersion>
</configuration>
</execution>
<execution>
<id>unpack-static-shell</id>
<phase>generate-test-resources</phase>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<includeGroupIds>org.glassfish.main.distributions</includeGroupIds>
<outputDirectory>${surefire.workdir}</outputDirectory>
<stripVersion>true</stripVersion>
</configuration>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.junit.jupiter.api.extension.ExtensionContext;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.ArgumentsProvider;
import org.junit.jupiter.params.support.ParameterDeclarations;

/**
*
Expand All @@ -32,15 +33,27 @@ public class TestArgumentProviders {
public static class GfEmbeddedJarNameProvider implements ArgumentsProvider {

@Override
public Stream<? extends Arguments> provideArguments(ExtensionContext ec) throws Exception {
public Stream<? extends Arguments> provideArguments(ParameterDeclarations declarations, ExtensionContext ec) throws Exception {
List<Arguments> arguments = new ArrayList<>();
arguments.add(Arguments.of("glassfish-embedded-all.jar"));
if (!GfEmbeddedUtils.isDebugEnabled()) {
arguments.add(Arguments.of("glassfish-embedded-web.jar"));
arguments.add(Arguments.of("glassfishXX/glassfish/lib/embedded/glassfish-embedded-static-shell.jar"
Copy link
Contributor

@dmatej dmatej Oct 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The root directory can have any name. Subdirectories should not be changed, so we can rely on glassfish, but its parent doesn't have any convention, people do rename it.

.replace("XX", getGlassFishMajorVersion())));
}
return arguments.stream();
}

private static String getGlassFishMajorVersion() {
String versionProperty = "glassfish.version";
String version = System.getProperty(versionProperty);
if (version != null) {
return version.split("\\.")[0];
} else {
throw new IllegalArgumentException("The " + versionProperty + " system property is not defined. It should define the GlassFish version");
}
}

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ public synchronized void shutdown() throws GlassFishException {
}

private void setEnv(GlassFishProperties gfProps) throws Exception {
gfProps.setProperty("-type", "EMBEDDED");
String instanceRootValue = gfProps.getInstanceRoot();
if (instanceRootValue == null) {
instanceRootValue = createTempInstanceRoot(gfProps);
Expand All @@ -144,7 +145,6 @@ private void setEnv(GlassFishProperties gfProps) throws Exception {
String installRootValue = System.getProperty("org.glassfish.embeddable.installRoot");
if (installRootValue == null) {
installRootValue = instanceRoot.getAbsolutePath();
gfProps.setProperty("-type", "EMBEDDED");
JarUtil.extractRars(installRootValue);
}
JarUtil.setEnv(installRootValue);
Expand Down