This is an automated email from the ASF dual-hosted git repository.

houston pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/branch_9x by this push:
     new 508fc99d79a SOLR-17790: Allow -j option to start with a dash (#3392)
508fc99d79a is described below

commit 508fc99d79ae3edd023fa240b10474aacdabd916
Author: Houston Putman <[email protected]>
AuthorDate: Mon Jun 16 17:21:09 2025 -0500

    SOLR-17790: Allow -j option to start with a dash (#3392)
    
    (cherry picked from commit 8a3e4c87a3b167fe276efaac2621d5ce5646122e)
---
 solr/CHANGES.txt                         | 2 ++
 solr/bin/solr                            | 2 +-
 solr/packaging/test/test_start_solr.bats | 8 ++++++++
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 269e4b2c31d..137f6e7bdb1 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -118,6 +118,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 a49cc54e537..648fccd7b23 100755
--- a/solr/bin/solr
+++ b/solr/bin/solr
@@ -841,7 +841,7 @@ if [ $# -gt 0 ]; then
             shift 2
         ;;
         -j|--jettyconfig|-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 f6ca16d5fbf..b028e0fe059 100644
--- a/solr/packaging/test/test_start_solr.bats
+++ b/solr/packaging/test/test_start_solr.bats
@@ -98,3 +98,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
+}

Reply via email to