Skip to content

Commit 267c065

Browse files
committed
ARTEMIS-5364 clean up scripts & profiles
This commit cleans up the various scripts and profile files via the following changes: - Remove ARTEMIS_INSTANCE_URI from all profiles since it is no longer used after we moved to Log4j2 - Remove ARTEMIS_INSTANCE_ETC_URI from all profiles; it is not necessary because the jolokia-access.xml can be loaded directly from the classpath - Remove ARTEMIS_ETC_DIR from all profiles and instead rely on ARTEMIS_INSTANCE_ETC which is already being set in the scripts - Remove unnecessary code from Create command - Remove ARTEMIS_OOME_DUMP from the utility profiles since it's not used - Adjust Upgrade command & related tests - Fix Windows service file so it uses the same memory settings as the other configs - Update the Windows' profile JAVA_ARGS to match those from Linux
1 parent 1c2221f commit 267c065

File tree

11 files changed

+24
-85
lines changed

11 files changed

+24
-85
lines changed

artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java

-2
Original file line numberDiff line numberDiff line change
@@ -930,12 +930,10 @@ protected static void addScriptFilters(Map<String, String> filters,
930930
// so that's just to make a distinction
931931
filters.put("@artemis.instance@", path(directory));
932932
filters.put("${artemis.instance.uri}", directory.toURI().toString());
933-
filters.put("${artemis.instance.uri.windows}", directory.toURI().toString().replaceAll("%", "%%"));
934933
filters.put("${artemis.instance.name}", directory.getName());
935934
filters.put("${java.home}", path(System.getProperty("java.home")));
936935

937936
filters.put("${artemis.instance.etc.uri}", etcFolder.toURI().toString());
938-
filters.put("${artemis.instance.etc.uri.windows}", etcFolder.toURI().toString().replaceAll("%", "%%"));
939937
filters.put("${artemis.instance.etc}", path(etcFolder));
940938
filters.put("${artemis.instance.oome.dump}", path(oomeDumpFile));
941939
filters.put("${artemis.instance.data}", path(dataFolder));

artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Upgrade.java

+4-5
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ public Object run(ActionContext context) throws Exception {
156156
write(Create.BIN_ARTEMIS_SERVICE_XML, serviceXmlTmp, filters, false, false);
157157
upgrade(context, serviceXmlTmp, serviceXml, serviceXmlBkp, keepPrefixAlternates,
158158
"<env name=\"ARTEMIS_INSTANCE\"", "<env name=\"ARTEMIS_INSTANCE_ETC\"",
159-
"<env name=\"ARTEMIS_INSTANCE_URI\"", "<env name=\"ARTEMIS_INSTANCE_ETC_URI\"",
160159
"<env name=\"ARTEMIS_DATA_DIR\"", "<logpath>", "<startargument>-Xmx", "<stopargument>-Xmx",
161160
"<name>", "<id>", "<startargument>-Dhawtio.roles=");
162161

@@ -166,7 +165,7 @@ public Object run(ActionContext context) throws Exception {
166165

167166
write("etc/" + Create.ETC_ARTEMIS_PROFILE_CMD, artemisProfileCmdTmp, filters, false, false);
168167
upgradeJDK(context, JDK_PREFIX_WINDOWS, "", KEEPING_JVM_ARGUMENTS_ALTERNATES, KEEPING_JVM_ARGUMENTS, artemisProfileCmdTmp, artemisProfileCmd, artemisProfileCmdBkp,
169-
Collections.emptyMap(), "set ARTEMIS_INSTANCE=\"", "set ARTEMIS_DATA_DIR=", "set ARTEMIS_ETC_DIR=", "set ARTEMIS_OOME_DUMP=", "set ARTEMIS_INSTANCE_URI=", "set ARTEMIS_INSTANCE_ETC_URI=");
168+
Collections.emptyMap(), "set ARTEMIS_INSTANCE=\"", "set ARTEMIS_DATA_DIR=", "set ARTEMIS_OOME_DUMP=");
170169

171170
File artemisUtilityProfileCmd = new File(etcFolder, Create.ETC_ARTEMIS_UTILITY_PROFILE_CMD);
172171
File artemisUtilityProfileCmdTmp = new File(tmp, Create.ETC_ARTEMIS_UTILITY_PROFILE_CMD);
@@ -175,7 +174,7 @@ public Object run(ActionContext context) throws Exception {
175174
if (artemisUtilityProfileCmd.exists()) {
176175
write("etc/" + Create.ETC_ARTEMIS_UTILITY_PROFILE_CMD, artemisUtilityProfileCmdTmp, filters, false, false);
177176
upgradeJDK(context, JDK_PREFIX_WINDOWS, "", KEEPING_JVM_ARGUMENTS_ALTERNATES, KEEPING_JVM_ARGUMENTS, artemisUtilityProfileCmdTmp, artemisUtilityProfileCmd, artemisUtilityProfileCmdBkp,
178-
Collections.emptyMap(), "set ARTEMIS_INSTANCE=\"", "set ARTEMIS_DATA_DIR=", "set ARTEMIS_ETC_DIR=", "set ARTEMIS_OOME_DUMP=", "set ARTEMIS_INSTANCE_URI=", "set ARTEMIS_INSTANCE_ETC_URI=");
177+
Collections.emptyMap(), "set ARTEMIS_INSTANCE=\"", "set ARTEMIS_DATA_DIR=");
179178
} else {
180179
if (data == null || data.equals("data")) {
181180
dataFolder = getDATA(context, dataFolder, artemisProfileCmd, "set ARTEMIS_DATA_DIR=");
@@ -210,7 +209,7 @@ public Object run(ActionContext context) throws Exception {
210209

211210
write("etc/" + Create.ETC_ARTEMIS_PROFILE, artemisProfileTmp, filters, false, false);
212211
upgradeJDK(context, JDK_PREFIX_LINUX, "\"", KEEPING_JVM_ARGUMENTS_ALTERNATES, KEEPING_JVM_ARGUMENTS, artemisProfileTmp, artemisProfile, artemisProfileBkp,
213-
keepPrefixAlternates, "ARTEMIS_INSTANCE=", "ARTEMIS_DATA_DIR=", "ARTEMIS_ETC_DIR=", "ARTEMIS_OOME_DUMP=", "ARTEMIS_INSTANCE_URI=", "ARTEMIS_INSTANCE_ETC_URI=", "HAWTIO_ROLES=");
212+
keepPrefixAlternates, "ARTEMIS_INSTANCE=", "ARTEMIS_DATA_DIR=", "ARTEMIS_OOME_DUMP=", "HAWTIO_ROLES=");
214213

215214
File artemisUtilityProfile = new File(etcFolder, Create.ETC_ARTEMIS_UTILITY_PROFILE);
216215
File artemisUtilityProfileTmp = new File(tmp, Create.ETC_ARTEMIS_UTILITY_PROFILE);
@@ -219,7 +218,7 @@ public Object run(ActionContext context) throws Exception {
219218
if (artemisUtilityProfile.exists()) {
220219
write("etc/" + Create.ETC_ARTEMIS_UTILITY_PROFILE, artemisUtilityProfileTmp, filters, false, false);
221220
upgradeJDK(context, JDK_PREFIX_LINUX, "\"", KEEPING_JVM_ARGUMENTS_ALTERNATES, KEEPING_JVM_ARGUMENTS, artemisUtilityProfileTmp, artemisUtilityProfile, artemisUtilityProfileBkp,
222-
keepPrefixAlternates, "ARTEMIS_INSTANCE=", "ARTEMIS_DATA_DIR=", "ARTEMIS_ETC_DIR=", "ARTEMIS_OOME_DUMP=", "ARTEMIS_INSTANCE_URI=", "ARTEMIS_INSTANCE_ETC_URI=", "HAWTIO_ROLES=");
221+
keepPrefixAlternates, "ARTEMIS_INSTANCE=", "ARTEMIS_DATA_DIR=");
223222
} else {
224223
if (data == null || data.equals("data")) {
225224
dataFolder = getDATA(context, dataFolder, artemisProfile, "ARTEMIS_DATA_DIR=");

artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/bin/artemis-service.xml

+3-8
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,15 @@
2525
<env name="ARTEMIS_HOME" value="${artemis.home}"/>
2626
<env name="ARTEMIS_INSTANCE" value="@artemis.instance@"/>
2727
<env name="ARTEMIS_INSTANCE_ETC" value="${artemis.instance.etc}"/>
28-
<env name="ARTEMIS_INSTANCE_URI" value="${artemis.instance.uri}"/>
29-
<env name="ARTEMIS_INSTANCE_ETC_URI" value="${artemis.instance.etc.uri}"/>
3028
<env name="ARTEMIS_DATA_DIR" value="${artemis.instance.data}"/>
3129

3230
<logpath>@artemis.instance@\log</logpath>
3331
<logmode>roll</logmode>
3432

3533
<executable>%JAVA_HOME%\bin\java.exe</executable>
36-
<startargument>-XX:+UseParallelGC</startargument>
34+
<startargument>-XX:+UseG1GC</startargument>
3735
<startargument>-Xms512M</startargument>
38-
<startargument>-Xmx1024M</startargument>
36+
<startargument>-Xmx${java-memory}</startargument>
3937

4038
<!-- Cluster Properties: Used to pass startarguments to ActiveMQ Artemis which can be referenced in broker.xml
4139
<startargument>-Dartemis.remoting.default.port=61617</startargument>
@@ -56,7 +54,7 @@
5654
<startargument>-Dhawtio.offline="true"</startargument>
5755
<startargument>-Dhawtio.roles=${role}</startargument>
5856
<startargument>-Dhawtio.rolePrincipalClasses=org.apache.activemq.artemis.spi.core.security.jaas.RolePrincipal</startargument>
59-
<startargument>-Djolokia.policyLocation=%ARTEMIS_INSTANCE_ETC_URI%/jolokia-access.xml</startargument>
57+
<startargument>-Djolokia.policyLocation=classpath:jolokia-access.xml</startargument>
6058

6159
<!-- Debug args: Uncomment to enable debug
6260
<startargument>-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005</startargument>
@@ -67,9 +65,6 @@
6765
<startargument>run</startargument>
6866

6967
<stopexecutable>%JAVA_HOME%\bin\java.exe</stopexecutable>
70-
<stopargument>-XX:+UseParallelGC</stopargument>
71-
<stopargument>-Xms512M</stopargument>
72-
<stopargument>-Xmx1024M</stopargument>
7368

7469
<stopargument>-classpath</stopargument>
7570
<stopargument>%ARTEMIS_HOME%\lib\artemis-boot.jar</stopargument>

artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/bin/artemis.cmd

+1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ set JVM_ARGS=%JVM_ARGS% -Dartemis.home=%ARTEMIS_HOME%
8080
set JVM_ARGS=%JVM_ARGS% -Dartemis.instance=%ARTEMIS_INSTANCE%
8181
set JVM_ARGS=%JVM_ARGS% -Ddata.dir=%ARTEMIS_DATA_DIR%
8282
set JVM_ARGS=%JVM_ARGS% -Dartemis.instance.etc=%ARTEMIS_INSTANCE_ETC%
83+
set JVM_ARGS=%JVM_ARGS% -Djava.security.auth.login.config=%ARTEMIS_INSTANCE_ETC%\login.config
8384

8485
if not "%DEBUG_ARGS%"=="" set JVM_ARGS=%JVM_ARGS% %DEBUG_ARGS%
8586
if not "%$JAVA_ARGS_APPEND%"=="" set JVM_ARGS=%JVM_ARGS% %$JAVA_ARGS_APPEND%

artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/artemis-utility.profile

+1-9
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,9 @@
1818
ARTEMIS_HOME='${artemis.home}'
1919
ARTEMIS_INSTANCE='@artemis.instance@'
2020
ARTEMIS_DATA_DIR='${artemis.instance.data}'
21-
ARTEMIS_ETC_DIR='${artemis.instance.etc}'
22-
ARTEMIS_OOME_DUMP='${artemis.instance.oome.dump}'
23-
24-
# The logging config will need an URI
25-
# this will be encoded in case you use spaces or special characters
26-
# on your directory structure
27-
ARTEMIS_INSTANCE_URI='${artemis.instance.uri}'
28-
ARTEMIS_INSTANCE_ETC_URI='${artemis.instance.etc.uri}'
2921

3022
if [ -z "$LOGGING_ARGS" ]; then
31-
LOGGING_ARGS="-Dlog4j2.configurationFile=${ARTEMIS_INSTANCE_ETC_URI}log4j2-utility.properties"
23+
LOGGING_ARGS="-Dlog4j2.configurationFile=log4j2-utility.properties"
3224
fi
3325

3426
if [ -z "$JAVA_ARGS" ]; then

artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/artemis-utility.profile.cmd

+1-10
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,8 @@ rem under the License.
1919
set ARTEMIS_HOME="${artemis.home}"
2020
set ARTEMIS_INSTANCE="@artemis.instance@"
2121
set ARTEMIS_DATA_DIR="${artemis.instance.data}"
22-
set ARTEMIS_ETC_DIR="${artemis.instance.etc}"
23-
set ARTEMIS_OOME_DUMP="${artemis.instance.oome.dump}"
2422

25-
26-
rem The logging config will need an URI
27-
rem this will be encoded in case you use spaces or special characters
28-
rem on your directory structure
29-
set ARTEMIS_INSTANCE_URI="${artemis.instance.uri.windows}"
30-
set ARTEMIS_INSTANCE_ETC_URI="${artemis.instance.etc.uri.windows}"
31-
32-
IF "%LOGGING_ARGS%"=="" (set LOGGING_ARGS=-Dlog4j2.configurationFile=%ARTEMIS_INSTANCE_ETC_URI%log4j2-utility.properties)
23+
IF "%LOGGING_ARGS%"=="" (set LOGGING_ARGS=-Dlog4j2.configurationFile=log4j2-utility.properties)
3324

3425
IF "%JAVA_ARGS%"=="" (set JAVA_ARGS=-Dlog4j2.disableJmx=true --add-opens java.base/jdk.internal.misc=ALL-UNNAMED ${java-utility-opts})
3526

artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/artemis.profile

+1-8
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,8 @@
1818
ARTEMIS_HOME='${artemis.home}'
1919
ARTEMIS_INSTANCE='@artemis.instance@'
2020
ARTEMIS_DATA_DIR='${artemis.instance.data}'
21-
ARTEMIS_ETC_DIR='${artemis.instance.etc}'
2221
ARTEMIS_OOME_DUMP='${artemis.instance.oome.dump}'
2322

24-
# The logging config will need an URI
25-
# this will be encoded in case you use spaces or special characters
26-
# on your directory structure
27-
ARTEMIS_INSTANCE_URI='${artemis.instance.uri}'
28-
ARTEMIS_INSTANCE_ETC_URI='${artemis.instance.etc.uri}'
29-
3023
# Cluster Properties: Used to pass arguments to ActiveMQ Artemis which can be referenced in broker.xml
3124
#ARTEMIS_CLUSTER_PROPS="-Dactivemq.remoting.default.port=61617 -Dactivemq.remoting.amqp.port=5673 -Dactivemq.remoting.stomp.port=61614 -Dactivemq.remoting.hornetq.port=5446"
3225

@@ -37,7 +30,7 @@ HAWTIO_ROLES='${role}'
3730

3831
# Java Opts
3932
if [ -z "$JAVA_ARGS" ]; then
40-
JAVA_ARGS="-XX:AutoBoxCacheMax=20000 -XX:+PrintClassHistogram -XX:+UseG1GC -XX:+UseStringDeduplication -Xms512M -Xmx${java-memory} -Dhawtio.disableProxy=true -Dhawtio.realm=activemq -Dhawtio.offline=true -Dhawtio.rolePrincipalClasses=org.apache.activemq.artemis.spi.core.security.jaas.RolePrincipal -Dhawtio.http.strictTransportSecurity=max-age=31536000;includeSubDomains;preload -Djolokia.policyLocation=${ARTEMIS_INSTANCE_ETC_URI}jolokia-access.xml -Dlog4j2.disableJmx=true --add-opens java.base/jdk.internal.misc=ALL-UNNAMED ${java-opts}"
33+
JAVA_ARGS="-XX:AutoBoxCacheMax=20000 -XX:+PrintClassHistogram -XX:+UseG1GC -XX:+UseStringDeduplication -Xms512M -Xmx${java-memory} -Dhawtio.disableProxy=true -Dhawtio.realm=activemq -Dhawtio.offline=true -Dhawtio.rolePrincipalClasses=org.apache.activemq.artemis.spi.core.security.jaas.RolePrincipal -Dhawtio.http.strictTransportSecurity=max-age=31536000;includeSubDomains;preload -Djolokia.policyLocation=classpath:jolokia-access.xml -Dlog4j2.disableJmx=true --add-opens java.base/jdk.internal.misc=ALL-UNNAMED ${java-opts}"
4134
fi
4235

4336
# Uncomment to enable logging for Safepoint JVM pauses

artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/artemis.profile.cmd

+1-9
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,13 @@ rem under the License.
1919
set ARTEMIS_HOME="${artemis.home}"
2020
set ARTEMIS_INSTANCE="@artemis.instance@"
2121
set ARTEMIS_DATA_DIR="${artemis.instance.data}"
22-
set ARTEMIS_ETC_DIR="${artemis.instance.etc}"
2322
set ARTEMIS_OOME_DUMP="${artemis.instance.oome.dump}"
2423

25-
26-
rem The logging config will need an URI
27-
rem this will be encoded in case you use spaces or special characters
28-
rem on your directory structure
29-
set ARTEMIS_INSTANCE_URI="${artemis.instance.uri.windows}"
30-
set ARTEMIS_INSTANCE_ETC_URI="${artemis.instance.etc.uri.windows}"
31-
3224
rem Cluster Properties: Used to pass arguments to ActiveMQ Artemis which can be referenced in broker.xml
3325
rem set ARTEMIS_CLUSTER_PROPS=-Dactivemq.remoting.default.port=61617 -Dactivemq.remoting.amqp.port=5673 -Dactivemq.remoting.stomp.port=61614 -Dactivemq.remoting.hornetq.port=5446
3426

3527
rem Java Opts
36-
IF "%JAVA_ARGS%"=="" (set JAVA_ARGS=${java-opts} -XX:AutoBoxCacheMax=20000 -XX:+PrintClassHistogram -XX:+UseG1GC -XX:+UseStringDeduplication -Xms512M -Xmx${java-memory} -Djava.security.auth.login.config=%ARTEMIS_ETC_DIR%\login.config -Dhawtio.disableProxy=true -Dhawtio.offline=true -Dhawtio.realm=activemq -Dhawtio.roles=${role} -Dhawtio.rolePrincipalClasses=org.apache.activemq.artemis.spi.core.security.jaas.RolePrincipal -Dhawtio.http.strictTransportSecurity=max-age=31536000;includeSubDomains;preload -Djolokia.policyLocation=%ARTEMIS_INSTANCE_ETC_URI%\jolokia-access.xml -Dartemis.instance=%ARTEMIS_INSTANCE% --add-opens java.base/jdk.internal.misc=ALL-UNNAMED -Dlog4j2.disableJmx=true)
28+
IF "%JAVA_ARGS%"=="" (set JAVA_ARGS=-XX:AutoBoxCacheMax=20000 -XX:+PrintClassHistogram -XX:+UseG1GC -XX:+UseStringDeduplication -Xms512M -Xmx${java-memory} -Dhawtio.disableProxy=true -Dhawtio.realm=activemq -Dhawtio.offline=true -Dhawtio.rolePrincipalClasses=org.apache.activemq.artemis.spi.core.security.jaas.RolePrincipal -Dhawtio.http.strictTransportSecurity=max-age=31536000;includeSubDomains;preload -Djolokia.policyLocation=classpath:jolokia-access.xml -Dlog4j2.disableJmx=true --add-opens java.base/jdk.internal.misc=ALL-UNNAMED -Dhawtio.roles=${role} ${java-opts} )
3729

3830
rem Logs Safepoints JVM pauses: Uncomment to enable them
3931
rem In addition to the traditional GC logs you could enable some JVM flags to know any meaningful and "hidden" pause that could

artemis-cli/src/test/java/org/apache/activemq/artemis/util/JVMArgumentTest.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ private void doArgumentsWindowsTestImpl(boolean useNewArgPropName) {
4848
final String arguments;
4949
if (useNewArgPropName) {
5050
// Uses new args prop -Dhawtio.roles=
51-
arguments = "IF \"%JAVA_ARGS%\"==\"\" (set JAVA_ARGS= -must-go -XX:AutoBoxCacheMax=20000 -XX:+PrintClassHistogram -XX:+UseG1GC -XX:+UseStringDeduplication -Xms333M -Xmx77G -Djava.security.auth.login.config=%ARTEMIS_ETC_DIR%\\login.config -Dhawtio.disableProxy=true -Dhawtio.offline=true -Dhawtio.realm=activemq -Dhawtio.roles=amq -Dhawtio.rolePrincipalClasses=org.apache.activemq.artemis.spi.core.security.jaas.RolePrincipal -Dhawtio.http.strictTransportSecurity=max-age=31536000;includeSubDomains;preload -Djolokia.policyLocation=%ARTEMIS_INSTANCE_ETC_URI%\\jolokia-access.xml -Dartemis.instance=%ARTEMIS_INSTANCE% --add-opens java.base/jdk.internal.misc=ALL-UNNAMED -Dlog4j2.disableJmx=true)";
51+
arguments = "IF \"%JAVA_ARGS%\"==\"\" (set JAVA_ARGS= -must-go -XX:AutoBoxCacheMax=20000 -XX:+PrintClassHistogram -XX:+UseG1GC -XX:+UseStringDeduplication -Xms333M -Xmx77G -Dhawtio.disableProxy=true -Dhawtio.offline=true -Dhawtio.realm=activemq -Dhawtio.roles=amq -Dhawtio.rolePrincipalClasses=org.apache.activemq.artemis.spi.core.security.jaas.RolePrincipal -Dhawtio.http.strictTransportSecurity=max-age=31536000;includeSubDomains;preload -Djolokia.policyLocation=classpath:jolokia-access.xml --add-opens java.base/jdk.internal.misc=ALL-UNNAMED -Dlog4j2.disableJmx=true)";
5252
} else {
5353
// Uses old args prop -Dhawtio.role=
54-
arguments = "IF \"%JAVA_ARGS%\"==\"\" (set JAVA_ARGS= -must-go -XX:AutoBoxCacheMax=20000 -XX:+PrintClassHistogram -XX:+UseG1GC -XX:+UseStringDeduplication -Xms333M -Xmx77G -Djava.security.auth.login.config=%ARTEMIS_ETC_DIR%\\login.config -Dhawtio.disableProxy=true -Dhawtio.offline=true -Dhawtio.realm=activemq -Dhawtio.role=amq -Dhawtio.rolePrincipalClasses=org.apache.activemq.artemis.spi.core.security.jaas.RolePrincipal -Dhawtio.http.strictTransportSecurity=max-age=31536000;includeSubDomains;preload -Djolokia.policyLocation=%ARTEMIS_INSTANCE_ETC_URI%\\jolokia-access.xml -Dartemis.instance=%ARTEMIS_INSTANCE% --add-opens java.base/jdk.internal.misc=ALL-UNNAMED -Dlog4j2.disableJmx=true)";
54+
arguments = "IF \"%JAVA_ARGS%\"==\"\" (set JAVA_ARGS= -must-go -XX:AutoBoxCacheMax=20000 -XX:+PrintClassHistogram -XX:+UseG1GC -XX:+UseStringDeduplication -Xms333M -Xmx77G -Dhawtio.disableProxy=true -Dhawtio.offline=true -Dhawtio.realm=activemq -Dhawtio.role=amq -Dhawtio.rolePrincipalClasses=org.apache.activemq.artemis.spi.core.security.jaas.RolePrincipal -Dhawtio.http.strictTransportSecurity=max-age=31536000;includeSubDomains;preload -Djolokia.policyLocation=classpath:jolokia-access.xml --add-opens java.base/jdk.internal.misc=ALL-UNNAMED -Dlog4j2.disableJmx=true)";
5555
}
5656

5757
String prefix = "IF \"%JAVA_ARGS%\"==\"\" (set JAVA_ARGS= ";
@@ -66,7 +66,7 @@ private void doArgumentsWindowsTestImpl(boolean useNewArgPropName) {
6666
assertEquals("-Xms333M", usedArgs.get("-Xms"));
6767
assertEquals("-Dhawtio.roles=amq", usedArgs.get("-Dhawtio.roles="));
6868

69-
String newLine = "IF \"%JAVA_ARGS%\"==\"\" (set JAVA_ARGS= -XX:AutoBoxCacheMax=20000 -XX:+PrintClassHistogram -XX:+UseG1GC -XX:+UseStringDeduplication -Xms512M -Xmx1G -Djava.security.auth.login.config=%ARTEMIS_ETC_DIR%\\login.config -Dhawtio.disableProxy=true -Dhawtio.offline=true -Dhawtio.realm=activemq -Dhawtio.roles=replaceThisRole -Dhawtio.rolePrincipalClasses=org.apache.activemq.artemis.spi.core.security.jaas.RolePrincipal -Djolokia.policyLocation=%ARTEMIS_INSTANCE_ETC_URI%\\jolokia-access.xml -Dartemis.instance=%ARTEMIS_INSTANCE%)";
69+
String newLine = "IF \"%JAVA_ARGS%\"==\"\" (set JAVA_ARGS= -XX:AutoBoxCacheMax=20000 -XX:+PrintClassHistogram -XX:+UseG1GC -XX:+UseStringDeduplication -Xms512M -Xmx1G -Dhawtio.disableProxy=true -Dhawtio.offline=true -Dhawtio.realm=activemq -Dhawtio.roles=replaceThisRole -Dhawtio.rolePrincipalClasses=org.apache.activemq.artemis.spi.core.security.jaas.RolePrincipal -Djolokia.policyLocation=classpath:jolokia-access.xml)";
7070

7171
String resultLine = JVMArgumentParser.parseNewLine(prefix, "\"", newLine, fixedArguments, usedArgs);
7272

@@ -85,7 +85,7 @@ private void doArgumentsWindowsTestImpl(boolean useNewArgPropName) {
8585

8686
@Test
8787
public void testArgumentsLinux() {
88-
String arguments = " JAVA_ARGS=\"-must-go -XX:AutoBoxCacheMax=20000 -XX:+PrintClassHistogram -XX:+UseG1GC -XX:+UseStringDeduplication -Xms333M -Xmx77G -Dhawtio.disableProxy=true -Dhawtio.realm=activemq -Dhawtio.offline=true -Dhawtio.rolePrincipalClasses=org.apache.activemq.artemis.spi.core.security.jaas.RolePrincipal -Dhawtio.http.strictTransportSecurity=max-age=31536000;includeSubDomains;preload -Djolokia.policyLocation=${ARTEMIS_INSTANCE_ETC_URI}jolokia-access.xml -Dlog4j2.disableJmx=true --add-opens java.base/jdk.internal.misc=ALL-UNNAMED \"";
88+
String arguments = " JAVA_ARGS=\"-must-go -XX:AutoBoxCacheMax=20000 -XX:+PrintClassHistogram -XX:+UseG1GC -XX:+UseStringDeduplication -Xms333M -Xmx77G -Dhawtio.disableProxy=true -Dhawtio.realm=activemq -Dhawtio.offline=true -Dhawtio.rolePrincipalClasses=org.apache.activemq.artemis.spi.core.security.jaas.RolePrincipal -Dhawtio.http.strictTransportSecurity=max-age=31536000;includeSubDomains;preload -Djolokia.policyLocation=classpath:jolokia-access.xml -Dlog4j2.disableJmx=true --add-opens java.base/jdk.internal.misc=ALL-UNNAMED \"";
8989

9090
String prefix = "JAVA_ARGS=";
9191

@@ -97,7 +97,7 @@ public void testArgumentsLinux() {
9797
assertEquals("-Xmx77G", usedArgs.get("-Xmx"));
9898
assertEquals("-Xms333M", usedArgs.get("-Xms"));
9999

100-
String newLine = " JAVA_ARGS=\"-XX:AutoBoxCacheMax=20000 -XX:+PrintClassHistogram -XX:+UseG1GC -XX:+UseStringDeduplication -Xms512M -Xmx1G -Dhawtio.disableProxy=true -Dhawtio.realm=activemq -Dhawtio.offline=true -Dhawtio.rolePrincipalClasses=org.apache.activemq.artemis.spi.core.security.jaas.RolePrincipal -Dhawtio.http.strictTransportSecurity=max-age=31536000;includeSubDomains;preload -Djolokia.policyLocation=${ARTEMIS_INSTANCE_ETC_URI}jolokia-access.xml -Dlog4j2.disableJmx=true --add-opens java.base/jdk.internal.misc=ALL-UNNAMED \"";
100+
String newLine = " JAVA_ARGS=\"-XX:AutoBoxCacheMax=20000 -XX:+PrintClassHistogram -XX:+UseG1GC -XX:+UseStringDeduplication -Xms512M -Xmx1G -Dhawtio.disableProxy=true -Dhawtio.realm=activemq -Dhawtio.offline=true -Dhawtio.rolePrincipalClasses=org.apache.activemq.artemis.spi.core.security.jaas.RolePrincipal -Dhawtio.http.strictTransportSecurity=max-age=31536000;includeSubDomains;preload -Djolokia.policyLocation=classpath:jolokia-access.xml -Dlog4j2.disableJmx=true --add-opens java.base/jdk.internal.misc=ALL-UNNAMED \"";
101101

102102
String resultLine = JVMArgumentParser.parseNewLine(prefix, "\"", newLine, fixedArguments, usedArgs);
103103

0 commit comments

Comments
 (0)