GitHub user LinkMJB opened a pull request:
https://github.com/apache/lucene-solr/pull/508
Simplified JAVA_VER_NUM to utilize single expr execution
The fragility of the previous JAVA_VER_NUM causes solr to fail to start
when JAVA_TOOL_OPTIONS is set:
```
+ /jenkins/tools/hudson.model.JDK/jdk8-latest/bin/java -version
+ JAVA_VER=Picked up JAVA_TOOL_OPTIONS:
-Dmaven.ext.class.path="/jenkins/workspace/Bates/bates-java_ver-test/7@tmp/withMavena29da72d/pipeline-maven-spy.jar"
-Dorg.jenkinsci.plugins.pipeline.maven.reportsFolder="/jenkins/workspace/Bates/bates-java_ver-test/7@tmp/withMavena29da72d"
java version "1.8.0_172"
Java(TM) SE Runtime Environment (build 1.8.0_172-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.172-b11, mixed mode)
+ echo Picked up JAVA_TOOL_OPTIONS:
-Dmaven.ext.class.path="/jenkins/workspace/Bates/bates-java_ver-test/7@tmp/withMavena29da72d/pipeline-maven-spy.jar"
-Dorg.jenkinsci.plugins.pipeline.maven.reportsFolder="/jenkins/workspace/Bates/bates-java_ver-test/7@tmp/withMavena29da72d"
java version "1.8.0_172" Java(TM) SE Runtime Environment (build 1.8.0_172-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.172-b11, mixed mode)
+ head -1
+ awk -F " /version/ {print $2}
+ sed -e s/^1\.//
+ sed -e s/[._-].*$//
+ JAVA_VER_NUM=/jenkins/workspace/Bates/bates
+ echo /jenkins/workspace/Bates/bates
```
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/LinkMJB/lucene-solr master
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/lucene-solr/pull/508.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #508
----
commit 24f23aa35c9f14bd657a504e2f0b19d06eaee6dd
Author: Matthew Bates <matthew.bates@...>
Date: 2018-11-26T21:00:29Z
Updated JAVA_VER_NUM evaluation
JAVA_VER_NUM was a mess of pipes and extremely fragile. The specific case
this is regularly broken, is when JAVA_TOOL_OPTIONS is set:
```
+ /jenkins/tools/hudson.model.JDK/jdk8-latest/bin/java -version
+ JAVA_VER=Picked up JAVA_TOOL_OPTIONS:
-Dmaven.ext.class.path="/jenkins/workspace/Bates/bates-java_ver-test/7@tmp/withMavena29da72d/pipeline-maven-spy.jar"
-Dorg.jenkinsci.plugins.pipeline.maven.reportsFolder="/jenkins/workspace/Bates/bates-java_ver-test/7@tmp/withMavena29da72d"
java version "1.8.0_172"
Java(TM) SE Runtime Environment (build 1.8.0_172-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.172-b11, mixed mode)
+ echo Picked up JAVA_TOOL_OPTIONS:
-Dmaven.ext.class.path="/jenkins/workspace/Bates/bates-java_ver-test/7@tmp/withMavena29da72d/pipeline-maven-spy.jar"
-Dorg.jenkinsci.plugins.pipeline.maven.reportsFolder="/jenkins/workspace/Bates/bates-java_ver-test/7@tmp/withMavena29da72d"
java version "1.8.0_172" Java(TM) SE Runtime Environment (build 1.8.0_172-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.172-b11, mixed mode)
+ head -1
+ awk -F " /version/ {print $2}
+ sed -e s/^1.//
+ sed -e s/[._-].*$//
+ JAVA_VER_NUM=/jenkins/workspace/Bates/bates
+ echo /jenkins/workspace/Bates/bates
```
commit c60708c0b5a1a0d84517ef36bcc604d642970e91
Author: Matthew Bates <matthew.bates@...>
Date: 2018-11-26T21:03:45Z
Updated to grab only the major version using expr
----
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]