sha256:6e077b3464a8a99be9a9d9df52af3575633b0a0161d6fd6d1b37b165ae2f48a4
Last pushed
1 day by jfeeneydemo3
Type
Sandbox Kit
Manifest digest
sha256:6e077b3464a8a99be9a9d9df52af3575633b0a0161d6fd6d1b37b165ae2f48a4
schemaVersion: "3"
displayName: Java, Maven, and JUnit toolchain
description: Pinned current Java, Maven, Gradle, and JUnit tooling for JVM demos.
version: 1.2.0
kind: mixin
provides:
- [email protected]
- [email protected]
- [email protected]
- [email protected]
capabilities:
- type: com.docker.sandbox/network-policy@1
config:
runtime:
allow:
- repo.maven.apache.org
- repo1.maven.org
- plugins.gradle.org
- gitlab.com
- nexus.acme.internal
- central.sonatype.com
- repository.apache.org
- repository.ow2.org
- oss.sonatype.org
- type: com.docker.sandbox/lifecycle@1
config:
install:
- command: |
set -eu
f=/etc/sandbox-persistent.sh
touch "$f"
if ! grep -q 'java-maven-junit:env' "$f"; then
printf '%s\n' \
'# java-maven-junit:env' \
'export JAVA_HOME=/opt/java/openjdk' \
'export MAVEN_HOME=/usr/share/maven' \
'export GRADLE_HOME=/opt/gradle' >> "$f"
fi
description: Export JAVA_HOME, MAVEN_HOME, and GRADLE_HOME through the persistent environment file
user: "0"
- command: |
set -eu
mkdir -p /home/agent/.m2/repository /home/agent/.codex
touch /home/agent/.codex/config.toml
if grep -q '^\[sandbox_workspace_write\]' /home/agent/.codex/config.toml; then
echo "~/.codex/config.toml already has [sandbox_workspace_write]; leaving it unchanged"
else
printf '\n[sandbox_workspace_write]\nwritable_roots = ["/home/agent/.m2"]\nnetwork_access = true\n' >> /home/agent/.codex/config.toml
fi
description: Let Codex write to the Maven repository without approval prompts
user: agent
- type: com.docker.sandbox/agent-context@1
config:
content: |
Java, Maven, Gradle, and the JUnit Platform Console are installed.
Always use Maven to build and run applications, even though Gradle is
installed. The demo depends on a specific Maven plugin that has no
Gradle equivalent. Use the project's Maven wrapper (`./mvnw`) when
present; otherwise use `mvn`. Do not build with Gradle, even when a
`build.gradle` or `gradlew` is present.
Keep JUnit dependencies declared in the project POM rather than
relying on the standalone console jar.
args:
gradleVersion:
default: 9.8.1
description: Gradle release to install
pattern: ^[0-9]+\.[0-9]+(?:\.[0-9]+)?$
buildArg: GRADLE_VERSION
junitVersion:
default: 6.1.3
description: JUnit Platform Console Standalone release to install
pattern: ^[0-9]+\.[0-9]+\.[0-9]+$
buildArg: JUNIT_VERSION