Skip to content

Commit 9bb086a

Browse files
committed
Updated configurable infinispan-client-setup.sh
1 parent cf6a3e4 commit 9bb086a

File tree

1 file changed

+39
-14
lines changed

1 file changed

+39
-14
lines changed

ga/latest/kernel/helpers/build/infinispan-client-setup.sh

Lines changed: 39 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,14 @@
1616

1717
set -Eeo pipefail
1818

19-
INFINISPAN_LATEST_STABLE_VERSION="14.0.35.Final"
20-
INFINISPAN_CLIENT_VERSION=${INFINISPAN_CLIENT_VERSION:-$INFINISPAN_LATEST_STABLE_VERSION}
21-
INFINISPAN_USE_LATEST_STABLE=${INFINISPAN_USE_LATEST_STABLE:-false}
19+
# Recommended stable baseline for Jakarta EE 10 / JDK 17+ environments.
20+
INFINISPAN_DEFAULT_VERSION="15.2.6.Final"
21+
INFINISPAN_CLIENT_VERSION=${INFINISPAN_CLIENT_VERSION:-$INFINISPAN_DEFAULT_VERSION}
22+
23+
# Resolves the latest patch release (x.y.Z) within the specified major.minor version.
24+
INFINISPAN_USE_LATEST_PATCH=${INFINISPAN_USE_LATEST_PATCH:-false}
25+
# Required for Infinispan 11+ on Liberty. Hard dependency for Liberty sessionCache-1.0.
26+
INFINISPAN_ENABLE_REACTIVE_STREAMS=${INFINISPAN_ENABLE_REACTIVE_STREAMS:-true}
2227

2328
pkgcmd=yum
2429
if ! command $pkgcmd
@@ -28,7 +33,10 @@ fi
2833

2934
$pkgcmd update -y
3035
$pkgcmd install -y maven
31-
mkdir -p /opt/ibm/wlp/usr/shared/resources/infinispan
36+
37+
CLIENT_JARS_DIR="/opt/ibm/wlp/usr/shared/resources/infinispan"
38+
mkdir -p "${CLIENT_JARS_DIR}"
39+
3240
cat << EOF > /opt/ibm/wlp/usr/shared/resources/infinispan/pom.xml
3341
<project xmlns="http://maven.apache.org/POM/4.0.0"
3442
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -37,6 +45,7 @@ cat << EOF > /opt/ibm/wlp/usr/shared/resources/infinispan/pom.xml
3745
<groupId>io.openliberty</groupId>
3846
<artifactId>openliberty-infinispan-client</artifactId>
3947
<version>1.0</version>
48+
4049
<!-- https://mvnrepository.com/artifact/org.infinispan/infinispan-jcache-remote -->
4150
<dependencies>
4251
<dependency>
@@ -48,18 +57,34 @@ cat << EOF > /opt/ibm/wlp/usr/shared/resources/infinispan/pom.xml
4857
</project>
4958
EOF
5059

51-
if [ "${INFINISPAN_USE_LATEST_STABLE}" = "true" ]; then
52-
echo "Finding latest stable Infinispan client version..."
53-
mvn -f /opt/ibm/wlp/usr/shared/resources/infinispan/pom.xml versions:use-latest-releases -DallowMajorUpdates=false
60+
if [ "${INFINISPAN_USE_LATEST_PATCH}" = "true" ]; then
61+
echo "Resolving latest Infinispan client patch release (no major upgrades)..."
62+
mvn -f "${CLIENT_JARS_DIR}/pom.xml" versions:use-latest-releases -DallowMajorUpdates=false
5463
fi
55-
mvn -f /opt/ibm/wlp/usr/shared/resources/infinispan/pom.xml dependency:copy-dependencies -DoutputDirectory=/opt/ibm/wlp/usr/shared/resources/infinispan
64+
65+
mvn -f /opt/ibm/wlp/usr/shared/resources/infinispan/pom.xml dependency:copy-dependencies -DoutputDirectory="${CLIENT_JARS_DIR}"
5666
# This fails with dependency errors using microdnf on ubi-minimal, but it is okay to let it fail
5767
yum remove -y maven || true
58-
rm -f /opt/ibm/wlp/usr/shared/resources/infinispan/pom.xml
59-
rm -f /opt/ibm/wlp/usr/shared/resources/infinispan/jboss-transaction-api*.jar
60-
rm -f /opt/ibm/wlp/usr/shared/resources/infinispan/reactive-streams-*.jar
61-
rm -f /opt/ibm/wlp/usr/shared/resources/infinispan/rxjava-*.jar
68+
rm -f "${CLIENT_JARS_DIR}/pom.xml"
69+
70+
# Remove unnecessary spec jars
71+
rm -f "${CLIENT_JARS_DIR}"/jboss-transaction-api*.jar
72+
rm -f "${CLIENT_JARS_DIR}"/jakarta.transaction-api*.jar
73+
74+
# Reactive streams are required for Infinispan 11+ on Liberty sessionCache-1.0
75+
# Only remove if explicitly disabled (default: enabled)
76+
if [ "${INFINISPAN_ENABLE_REACTIVE_STREAMS}" != "true" ]; then
77+
echo "Removing reactive-streams and rxjava jars as INFINISPAN_ENABLE_REACTIVE_STREAMS is not set to true..."
78+
rm -f "${CLIENT_JARS_DIR}"/reactive-streams-*.jar
79+
rm -f "${CLIENT_JARS_DIR}"/rxjava-*.jar
80+
fi
81+
6282
rm -rf ~/.m2
63-
chown -R 1001:0 /opt/ibm/wlp/usr/shared/resources/infinispan
64-
chmod -R g+rw /opt/ibm/wlp/usr/shared/resources/infinispan
83+
chown -R 1001:0 "${CLIENT_JARS_DIR}"
84+
chmod -R g+rw "${CLIENT_JARS_DIR}"
6585

86+
INSTALLED_VERSION=$(find "${CLIENT_JARS_DIR}/" -name "*infinispan-commons*.jar" -printf "%f" | sed 's/infinispan-commons-\(.*\).jar/\1/')
87+
88+
if [ -n "$INSTALLED_VERSION" ]; then
89+
echo "Successfully installed Infinispan client version: ${INSTALLED_VERSION}"
90+
fi

0 commit comments

Comments
 (0)