Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-17790: Allow -j option to start with a dash (#3392)

Houston Putman8a3e4c87a3b1
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index a4bd16c5311..9457ebce1da 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -311,6 +311,8 @@ Bug Fixes
* SOLR-17769: Use S3 RetryStrategy instead of RetryPolicy. This fixes the error caused by using the "Adaptive" retry mode. (Houston Putman)
+* SOLR-17790: Allow the -j or --jettyconfig option to start with a dash (-). (Houston Putman)
+
Dependency Upgrades
---------------------
* SOLR-17471: Upgrade Lucene to 9.12.1. (Pierre Salagnac, Christine Poerschke)
diff --git a/solr/bin/solr b/solr/bin/solr
index 846ff39ce32..be0389a5eef 100755
--- a/solr/bin/solr
+++ b/solr/bin/solr
@@ -792,7 +792,7 @@ if [ $# -gt 0 ]; then
shift 2
;;
-j|--jettyconfig)
- if [[ -z "$2" || "${2:0:1}" == "-" ]]; then
+ if [[ -z "$2" ]]; then
print_usage "$SCRIPT_CMD" "Jetty config is required when using the $1 option!"
exit 1
fi
diff --git a/solr/packaging/test/test_start_solr.bats b/solr/packaging/test/test_start_solr.bats
index a4b80efe01d..8a8416f6ab2 100644
--- a/solr/packaging/test/test_start_solr.bats
+++ b/solr/packaging/test/test_start_solr.bats
@@ -80,3 +80,11 @@ teardown() {
run cat ${SOLR_LOGS_DIR}/solr-${SOLR_PORT}-console.log
refute_output --partial 'Exception'
}
+
+@test "start with custom jetty options" {
+ export ENABLE_REMOTE_JMX_OPTS=true
+ export RMI_PORT=65535 # need to make sure we don't exceed port range so hard code it
+
+ solr start -j "--module=server"
+ solr assert --started http://localhost:${SOLR_PORT} --timeout 5000
+}