Skip to content

Commit fd9ea17

Browse files
committed
feat: allow adding custom external jars to classpath
1 parent f0ab6c9 commit fd9ea17

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

ENV_VARIABLES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,3 +144,4 @@
144144
| SE_NODE_REGISTER_SHUTDOWN_ON_FAILURE | true | If this flag is enabled, the Node will shut down after the register period is completed. This is useful for container environments to restart and register again. If restarted multiple times, the Node container status will be CrashLoopBackOff | --register-shutdown-on-failure |
145145
| SE_NODE_RELAY_BROWSER_VERSION | | | |
146146
| SE_NODE_RELAY_ONLY | true | | |
147+
| SE_EXTRA_LIBS | | Extra jars to add to the classpath | --ext |

NodeBase/start-selenium-node.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,21 @@ if [ "$GENERATE_CONFIG" = true ]; then
129129
fi
130130

131131
EXTRA_LIBS=""
132+
if [ -n "${SE_EXTRA_LIBS}" ]; then
133+
echo "Adding external jars to classpath: ${SE_EXTRA_LIBS}"
134+
EXTRA_LIBS="--ext ${SE_EXTRA_LIBS}"
135+
fi
132136

133137
if [ "${SE_ENABLE_TRACING}" = "true" ] && [ -n "${SE_OTEL_EXPORTER_ENDPOINT}" ]; then
134138
EXTERNAL_JARS=$(</external_jars/.classpath.txt)
135-
[ -n "$EXTRA_LIBS" ] && [ -n "${EXTERNAL_JARS}" ] && EXTRA_LIBS=${EXTRA_LIBS}:
136-
EXTRA_LIBS="--ext "${EXTRA_LIBS}${EXTERNAL_JARS}
139+
if [ -n "${EXTRA_LIBS}" ] && [ -n "${EXTERNAL_JARS}" ]; then
140+
EXTRA_LIBS="${EXTRA_LIBS}:${EXTERNAL_JARS}"
141+
elif [ -z "${EXTRA_LIBS}" ] && [ -n "${EXTERNAL_JARS}" ]; then
142+
EXTRA_LIBS="--ext ${EXTERNAL_JARS}"
143+
fi
137144
echo "Tracing is enabled"
138-
echo "Classpath will be enriched with these external jars : " ${EXTRA_LIBS}
145+
echo "Classpath will be enriched with these external jars : ${EXTRA_LIBS}"
146+
139147
if [ -n "$SE_OTEL_SERVICE_NAME" ]; then
140148
SE_OTEL_JVM_ARGS="$SE_OTEL_JVM_ARGS -Dotel.resource.attributes=service.name=${SE_OTEL_SERVICE_NAME}"
141149
fi

0 commit comments

Comments
 (0)