This repository has been archived on 2026-11-08. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
qqq-orb/src/scripts/install_java.sh
T
james.maes c43666fb4c feat: switch to machine executor for Docker support
Replace cimg/openjdk Docker executor with Ubuntu machine executor
that has native Docker support. This enables Testcontainers and
LocalStack Docker extension tests to run properly in CI.

- Create install_java command to install Temurin JDK and Maven
- Add optional Node.js installation for frontend builds
- Update all Maven jobs to use machine executor
2025-12-28 11:15:06 -06:00

58 lines
1.7 KiB
Bash

#!/bin/bash
set -euo pipefail
# Install Java and Maven on Ubuntu machine executor
# Uses Eclipse Temurin (AdoptOpenJDK successor) for reliable JDK installation
# Optionally installs Node.js via NodeSource repository
JAVA_VERSION="${PARAM_JAVA_VERSION:-21}"
INSTALL_NODE="${PARAM_INSTALL_NODE:-false}"
NODE_VERSION="${PARAM_NODE_VERSION:-20}"
echo "Installing Java ${JAVA_VERSION} and Maven..."
# Add Eclipse Temurin repository
sudo apt-get update -qq
sudo apt-get install -y -qq wget apt-transport-https gpg maven curl
# Add Temurin GPG key
wget -qO - https://packages.adoptium.net/artifactory/api/gpg/key/public | sudo gpg --dearmor -o /usr/share/keyrings/adoptium.gpg
# Add repository
echo "deb [signed-by=/usr/share/keyrings/adoptium.gpg] https://packages.adoptium.net/artifactory/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/adoptium.list
# Install Java
sudo apt-get update -qq
sudo apt-get install -y -qq "temurin-${JAVA_VERSION}-jdk"
# Set JAVA_HOME
JAVA_HOME="/usr/lib/jvm/temurin-${JAVA_VERSION}-jdk-amd64"
echo "export JAVA_HOME=${JAVA_HOME}" >> "${BASH_ENV}"
echo "export PATH=${JAVA_HOME}/bin:\$PATH" >> "${BASH_ENV}"
# Install Node.js if requested
if [ "${INSTALL_NODE}" = "true" ]; then
echo ""
echo "Installing Node.js ${NODE_VERSION}..."
curl -fsSL "https://deb.nodesource.com/setup_${NODE_VERSION}.x" | sudo -E bash -
sudo apt-get install -y -qq nodejs
echo ""
echo "Node.js version:"
node --version
echo "npm version:"
npm --version
fi
# Verify installation
echo ""
echo "Java version:"
java -version
echo ""
echo "Maven version:"
mvn --version
echo ""
echo "Docker version:"
docker --version
echo ""
echo "Installation completed successfully"