Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 30 additions & 2 deletions ga/latest/kernel/helpers/build/infinispan-client-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@

set -Eeox pipefail

INFINISPAN_CLIENT_VERSION=${INFINISPAN_CLIENT_VERSION:-10.1.3.Final}
USE_LATEST_COMPATIBLE=${USE_LATEST_COMPATIBLE:-false}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this flag is specific to Infinispan, suggest using INFINISPAN_ as the prefix.


pkgcmd=yum
if ! command $pkgcmd
then
Expand All @@ -25,8 +28,29 @@ fi
$pkgcmd update -y
$pkgcmd install -y maven
mkdir -p /opt/ibm/wlp/usr/shared/resources/infinispan
echo '<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>io.openliberty</groupId> <artifactId>openliberty-infinispan-client</artifactId> <version>1.0</version> <!-- https://mvnrepository.com/artifact/org.infinispan/infinispan-jcache-remote --> <dependencies> <dependency> <groupId>org.infinispan</groupId> <artifactId>infinispan-jcache-remote</artifactId> <version>10.1.3.Final</version> </dependency> </dependencies></project>' > /opt/ibm/wlp/usr/shared/resources/infinispan/pom.xml
mvn -f /opt/ibm/wlp/usr/shared/resources/infinispan/pom.xml versions:use-latest-releases -DallowMajorUpdates=false
cat << EOF > /opt/ibm/wlp/usr/shared/resources/infinispan/pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>io.openliberty</groupId>
<artifactId>openliberty-infinispan-client</artifactId>
<version>1.0</version>
<!-- https://mvnrepository.com/artifact/org.infinispan/infinispan-jcache-remote -->
<dependencies>
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-jcache-remote</artifactId>
<version>${INFINISPAN_CLIENT_VERSION}</version>
</dependency>
</dependencies>
</project>
EOF

if [ "${USE_LATEST_COMPATIBLE}" = "true" ]; then
echo "Finding latest compatible Infinispan client version..."
mvn -f /opt/ibm/wlp/usr/shared/resources/infinispan/pom.xml versions:use-latest-releases -DallowMajorUpdates=false
fi
mvn -f /opt/ibm/wlp/usr/shared/resources/infinispan/pom.xml dependency:copy-dependencies -DoutputDirectory=/opt/ibm/wlp/usr/shared/resources/infinispan
# This fails with dependency errors using microdnf on ubi-minimal, but it is okay to let it fail
yum remove -y maven || true
Expand All @@ -38,3 +62,7 @@ rm -rf ~/.m2
chown -R 1001:0 /opt/ibm/wlp/usr/shared/resources/infinispan
chmod -R g+rw /opt/ibm/wlp/usr/shared/resources/infinispan

INSTALLED_VERSION=$(find /opt/ibm/wlp/usr/shared/resources/infinispan/ -name "*infinispan-commons*.jar" -printf "%f" | sed 's/infinispan-commons-\(.*\).jar/\1/')
if [ -n "$INSTALLED_VERSION" ]; then
echo "Successfully installed Infinispan client version: ${INSTALLED_VERSION}"
fi