Skip to content

Commit

Permalink
Implemented support for modulepath - bootstrap libs use it.
Browse files Browse the repository at this point in the history
Signed-off-by: David Matějček <david.matejcek@omnifish.ee>
  • Loading branch information
dmatej committed Oct 14, 2024
1 parent b419736 commit f463659
Show file tree
Hide file tree
Showing 48 changed files with 414 additions and 333 deletions.
16 changes: 2 additions & 14 deletions appserver/admin/cli-optional/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@
<groupId>org.glassfish.main.admin</groupId>
<artifactId>admin-cli</artifactId>
<version>${project.version}</version>
</dependency> <dependency>
</dependency>
<dependency>
<groupId>org.glassfish.main.core</groupId>
<artifactId>glassfish</artifactId>
<version>${project.version}</version>
Expand Down Expand Up @@ -138,18 +139,5 @@
</includes>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
+ <classpathPrefix>../../modules</classpathPrefix>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</project>
7 changes: 0 additions & 7 deletions appserver/admin/cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,7 @@
<archive>
<manifest>
<mainClass>org.glassfish.admin.cli.AsadminMain</mainClass>
<addClasspath>true</addClasspath>
<classpathLayoutType>custom</classpathLayoutType>
<customClasspathLayout>${artifact.artifactId}.${artifact.extension}</customClasspathLayout>
<classpathPrefix>../../modules</classpathPrefix>
</manifest>
<manifestEntries>
<Class-Path>../bootstrap/glassfish-jul-extension.jar ../bootstrap/glassfish-jdk-extensions.jar ../bootstrap/simple-glassfish-api.jar</Class-Path>
</manifestEntries>
</archive>
</configuration>
</plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ case "`uname`" in
CYGWIN*) AS_INSTALL=`cygpath --windows $AS_INSTALL`
esac
. "${AS_INSTALL}/config/asenv.conf"

JAVA=java
#Depends upon Java from asenv.conf
if [ ${AS_JAVA} ]; then
JAVA=${AS_JAVA}/bin/java
fi
AS_CLIENT="$AS_INSTALL/lib/client"

exec "$JAVA" "-Djava.util.logging.manager=org.glassfish.main.jul.GlassFishLogManager" -jar "$AS_CLIENT/appserver-cli.jar" "$@"
ASADMIN_CLASSPATH="$AS_INSTALL/appserver-cli.jar:$AS_INSTALL/admin-cli.jar:$AS_INSTALL/modules/*"
exec "$JAVA" "${ASADMIN_JVM_OPTIONS}" --module-path "${ASADMIN_MODULEPATH}" --add-modules ALL-MODULE-PATH -cp "$ASADMIN_CLASSPATH" org.glassfish.admin.cli.AsadminMain "$@"
Original file line number Diff line number Diff line change
@@ -1,33 +1,36 @@
@echo off
REM
REM Copyright (c) 2022, 2024 Contributors to the Eclipse Foundation
REM Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
REM
REM This program and the accompanying materials are made available under the
REM terms of the Eclipse Public License v. 2.0, which is available at
REM http://www.eclipse.org/legal/epl-2.0.
REM
REM This Source Code may also be made available under the following Secondary
REM Licenses when the conditions for such availability set forth in the
REM Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
REM version 2 with the GNU Classpath Exception, which is available at
REM https://www.gnu.org/software/classpath/license.html.
REM
REM SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
REM


VERIFY OTHER 2>nul
setlocal ENABLEEXTENSIONS
if ERRORLEVEL 0 goto ok
echo "Unable to enable extensions"
exit /B 1
:ok
call "%~dp0..\glassfish\config\asenv.bat"
if "%AS_JAVA%x" == "x" goto UsePath
set JAVA="%AS_JAVA%\bin\java"
goto run
:UsePath
set JAVA=java
:run
%JAVA% "-Djava.util.logging.manager=org.glassfish.main.jul.GlassFishLogManager" -jar "%~dp0..\glassfish\lib\client\appserver-cli.jar" %*
@echo off
REM
REM Copyright (c) 2022, 2024 Contributors to the Eclipse Foundation
REM Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
REM
REM This program and the accompanying materials are made available under the
REM terms of the Eclipse Public License v. 2.0, which is available at
REM http://www.eclipse.org/legal/epl-2.0.
REM
REM This Source Code may also be made available under the following Secondary
REM Licenses when the conditions for such availability set forth in the
REM Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
REM version 2 with the GNU Classpath Exception, which is available at
REM https://www.gnu.org/software/classpath/license.html.
REM
REM SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
REM

VERIFY OTHER 2>nul
setlocal ENABLEEXTENSIONS
if ERRORLEVEL 0 goto ok
echo "Unable to enable extensions"
exit /B 1

:ok
call "%~dp0..\glassfish\config\asenv.bat"
if "%AS_JAVA%x" == "x" goto UsePath
set JAVA="%AS_JAVA%\bin\java"
goto run

:UsePath
set JAVA=java

:run
set ASADMIN_CLASSPATH="%AS_INSTALL%/appserver-cli.jar:%AS_INSTALL%/admin-cli.jar:%AS_INSTALL%/modules/*"
%JAVA% "%ASADMIN_JVM_OPTIONS%" --module-path "%ASADMIN_MODULEPATH%" --add-modules ALL-MODULE-PATH -cp "%ASADMIN_CLASSPATH%" org.glassfish.admin.cli.AsadminMain %*
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@
#

AS_INSTALL=`dirname "$0"`/../glassfish
AS_INSTALL_LIB="$AS_INSTALL/lib"
. "${AS_INSTALL}/config/asenv.conf"

JAVA=java
#Depends upon Java from ../config/asenv.conf
if [ ${AS_JAVA} ]; then
JAVA=${AS_JAVA}/bin/java
fi

exec "$JAVA" "-Djava.util.logging.manager=org.glassfish.main.jul.GlassFishLogManager" -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=9008 -jar "$AS_INSTALL_LIB/client/appserver-cli.jar" "$@"
ASADMIN_CLASSPATH="$AS_INSTALL/appserver-cli.jar:$AS_INSTALL/admin-cli.jar:$AS_INSTALL/modules/*"
exec "$JAVA" "${ASADMIN_JVM_OPTIONS}" -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=9008 --module-path "${ASADMIN_MODULEPATH}" --add-modules ALL-MODULE-PATH -cp "$ASADMIN_CLASSPATH" org.glassfish.admin.cli.AsadminMain "$@"

Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,16 @@ setlocal ENABLEEXTENSIONS
if ERRORLEVEL 0 goto ok
echo "Unable to enable extensions"
exit /B 1

:ok
call "%~dp0..\glassfish\config\asenv.bat"
if "%AS_JAVA%x" == "x" goto UsePath
set JAVA="%AS_JAVA%\bin\java"
goto run

:UsePath
set JAVA=java

:run
%JAVA% "-Djava.util.logging.manager=org.glassfish.main.jul.GlassFishLogManager" -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=9008 -jar "%~dp0..\glassfish\lib\client\appserver-cli.jar" %*
set ASADMIN_CLASSPATH="%AS_INSTALL%/appserver-cli.jar:%AS_INSTALL%/admin-cli.jar:%AS_INSTALL%/modules/*"
%JAVA% "%ASADMIN_JVM_OPTIONS%" -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=9008 --module-path "%ASADMIN_MODULEPATH%" --add-modules ALL-MODULE-PATH -cp "%ASADMIN_CLASSPATH%" org.glassfish.admin.cli.AsadminMain %*
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,19 @@ AS_INSTALL=`dirname "$0"`/../glassfish
case "`uname`" in
CYGWIN*) AS_INSTALL=`cygpath --windows $AS_INSTALL`
esac
AS_INSTALL_LIB="$AS_INSTALL/modules"
. "${AS_INSTALL}/config/asenv.conf"

JAVA=java
#Depends upon Java from ../config/asenv.conf
if [ ${AS_JAVA} ]; then
JAVA=${AS_JAVA}/bin/java
fi

ASADMIN_CLASSPATH="$AS_INSTALL/appserver-cli.jar:$AS_INSTALL/admin-cli.jar:$AS_INSTALL/modules/*"

start_as_main_process () {
if [[ "$@" == "--help" ]] || [[ "$@" == "--help=true" ]] || [[ "$@" == "-?" ]]; then
exec java "-Djava.util.logging.manager=org.glassfish.main.jul.GlassFishLogManager" -jar "$ASADMIN_JAR" start-domain --help
exec "$JAVA" "${ASADMIN_JVM_OPTIONS}" --module-path "${ASADMIN_MODULEPATH}" --add-modules ALL-MODULE-PATH -cp "$ASADMIN_CLASSPATH" org.glassfish.admin.cli.AsadminMain start-domain --help
fi

# Execute start-domain --dry-run and store the output line by line into an array.
Expand All @@ -50,7 +52,7 @@ start_as_main_process () {
else
DRY_RUN_OUTPUT+=("$COM");
fi
done < <(java "-Djava.util.logging.manager=org.glassfish.main.jul.GlassFishLogManager" -jar "$ASADMIN_JAR" start-domain --dry-run "$@" || echo "FAILED" )
done < <("$JAVA" "${ASADMIN_JVM_OPTIONS}" --module-path "${ASADMIN_MODULEPATH}" --add-modules ALL-MODULE-PATH -cp "$ASADMIN_CLASSPATH" org.glassfish.admin.cli.AsadminMain start-domain --dry-run "$@" || echo "FAILED")
if [[ x"$DRY_RUN_OUTPUT" == x ]]
then
echo -n -e "${DRY_RUN_OUTPUT_BEFORE_DUMP}" >&2
Expand All @@ -65,7 +67,6 @@ start_as_main_process () {

}

ASADMIN_JAR="$AS_INSTALL_LIB/admin-cli.jar"
start_as_main_process "$@"

# Alternatively, run the following:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,21 @@ REM
REM SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
REM

VERIFY OTHER 2>nul
setlocal ENABLEEXTENSIONS
if ERRORLEVEL 0 goto ok
echo "Unable to enable extensions"
exit /B 1

java "-Djava.util.logging.manager=org.glassfish.main.jul.GlassFishLogManager" -jar "%~dp0..\glassfish\modules\admin-cli.jar" start-domain --verbose %*
:ok
call "%~dp0..\config\asenv.bat"
if "%AS_JAVA%x" == "x" goto UsePath
set JAVA="%AS_JAVA%\bin\java"
goto run

:UsePath
set JAVA=java

:run
set ASADMIN_CLASSPATH="%AS_INSTALL%/appserver-cli.jar:%AS_INSTALL%/admin-cli.jar:%AS_INSTALL%/modules/*"
%JAVA% "%ASADMIN_JVM_OPTIONS%" --module-path "%ASADMIN_MODULEPATH%" --add-modules ALL-MODULE-PATH -cp "%ASADMIN_CLASSPATH%" org.glassfish.admin.cli.AsadminMain start-domain --verbose %*
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,5 @@
#

AS_INSTALL=`dirname "$0"`/../glassfish
AS_INSTALL_LIB="$AS_INSTALL/modules"

exec java "-Djava.util.logging.manager=org.glassfish.main.jul.GlassFishLogManager" -jar "$AS_INSTALL_LIB/admin-cli.jar" stop-domain "$@"
exec java "-Djava.util.logging.manager=org.glassfish.main.jul.GlassFishLogManager" -jar "$AS_INSTALL/admin-cli.jar" stop-domain "$@"
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
@echo off
REM
REM Copyright (c) 2024 Contributors to the Eclipse Foundation
REM Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
REM
REM This program and the accompanying materials are made available under the
REM terms of the Eclipse Public License v. 2.0, which is available at
REM http://www.eclipse.org/legal/epl-2.0.
REM
REM This Source Code may also be made available under the following Secondary
REM Licenses when the conditions for such availability set forth in the
REM Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
REM version 2 with the GNU Classpath Exception, which is available at
REM https://www.gnu.org/software/classpath/license.html.
REM
REM SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
REM


java "-Djava.util.logging.manager=org.glassfish.main.jul.GlassFishLogManager" -jar "%~dp0..\glassfish\modules\admin-cli.jar" stop-domain %*
@echo off
REM
REM Copyright (c) 2024 Contributors to the Eclipse Foundation
REM Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
REM
REM This program and the accompanying materials are made available under the
REM terms of the Eclipse Public License v. 2.0, which is available at
REM http://www.eclipse.org/legal/epl-2.0.
REM
REM This Source Code may also be made available under the following Secondary
REM Licenses when the conditions for such availability set forth in the
REM Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
REM version 2 with the GNU Classpath Exception, which is available at
REM https://www.gnu.org/software/classpath/license.html.
REM
REM SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
REM


java "-Djava.util.logging.manager=org.glassfish.main.jul.GlassFishLogManager" -jar "%~dp0..\glassfish\admin-cli.jar" stop-domain %*
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ case "`uname`" in
CYGWIN*) AS_INSTALL=`cygpath --windows $AS_INSTALL`
esac
. "${AS_INSTALL}/config/asenv.conf"

JAVA=java
#Depends upon Java from asenv.conf
if [ ${AS_JAVA} ]; then
JAVA=${AS_JAVA}/bin/java
fi
AS_CLIENT=$AS_INSTALL/lib/client

exec "$JAVA" "-Djava.util.logging.manager=org.glassfish.main.jul.GlassFishLogManager" -jar "$AS_CLIENT/appserver-cli.jar" "$@"
ASADMIN_CLASSPATH="$AS_INSTALL/appserver-cli.jar:$AS_INSTALL/admin-cli.jar:$AS_INSTALL/modules/*"
exec "$JAVA" "${ASADMIN_JVM_OPTIONS}" --module-path "${ASADMIN_MODULEPATH}" --add-modules ALL-MODULE-PATH -cp "$ASADMIN_CLASSPATH" org.glassfish.admin.cli.AsadminMain "$@"
Original file line number Diff line number Diff line change
@@ -1,33 +1,36 @@
@echo off
REM
REM Copyright (c) 2022, 2024 Contributors to the Eclipse Foundation
REM Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
REM
REM This program and the accompanying materials are made available under the
REM terms of the Eclipse Public License v. 2.0, which is available at
REM http://www.eclipse.org/legal/epl-2.0.
REM
REM This Source Code may also be made available under the following Secondary
REM Licenses when the conditions for such availability set forth in the
REM Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
REM version 2 with the GNU Classpath Exception, which is available at
REM https://www.gnu.org/software/classpath/license.html.
REM
REM SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
REM


VERIFY OTHER 2>nul
setlocal ENABLEEXTENSIONS
if ERRORLEVEL 0 goto ok
echo "Unable to enable extensions"
exit /B 1
:ok
call "%~dp0..\config\asenv.bat"
if "%AS_JAVA%x" == "x" goto UsePath
set JAVA="%AS_JAVA%\bin\java"
goto run
:UsePath
set JAVA=java
:run
%JAVA% "-Djava.util.logging.manager=org.glassfish.main.jul.GlassFishLogManager" -jar "%~dp0..\lib\client\appserver-cli.jar" %*
@echo off
REM
REM Copyright (c) 2022, 2024 Contributors to the Eclipse Foundation
REM Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
REM
REM This program and the accompanying materials are made available under the
REM terms of the Eclipse Public License v. 2.0, which is available at
REM http://www.eclipse.org/legal/epl-2.0.
REM
REM This Source Code may also be made available under the following Secondary
REM Licenses when the conditions for such availability set forth in the
REM Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
REM version 2 with the GNU Classpath Exception, which is available at
REM https://www.gnu.org/software/classpath/license.html.
REM
REM SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
REM

VERIFY OTHER 2>nul
setlocal ENABLEEXTENSIONS
if ERRORLEVEL 0 goto ok
echo "Unable to enable extensions"
exit /B 1

:ok
call "%~dp0..\config\asenv.bat"
if "%AS_JAVA%x" == "x" goto UsePath
set JAVA="%AS_JAVA%\bin\java"
goto run

:UsePath
set JAVA=java

:run
set ASADMIN_CLASSPATH="%AS_INSTALL%/appserver-cli.jar:%AS_INSTALL%/admin-cli.jar:%AS_INSTALL%/modules/*"
%JAVA% "%ASADMIN_JVM_OPTIONS%" --module-path "%ASADMIN_MODULEPATH%" --add-modules ALL-MODULE-PATH -cp "%ASADMIN_CLASSPATH%" org.glassfish.admin.cli.AsadminMain %*
Loading

0 comments on commit f463659

Please sign in to comment.