aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoretienne-chrp <66628513+etienne-chrp@users.noreply.github.com>2022-11-17 03:46:30 +0300
committerGitHub <noreply@github.com>2022-11-17 03:46:30 +0300
commitbe4f0498e4ad7948804d4be70093c1da8722d222 (patch)
treea50ac3ee2038a5b4130b7bdfcace59b4140efc5b /src
parentbff31788373499fdc903bad8f1b300d579c42d39 (diff)
Add Gradle and Maven version parameters to Java (#263)
* Refactor java feature tests grep syntax The grep with pipe syntax was creating problems with the check helper Change them in favour of process substitution syntax * Fix java feature tests about java version Java 18 is not available anymore in SDKMAN Some tests asserts were generating false positives * Add Gradle and Maven version parameters to Java
Diffstat (limited to 'src')
-rw-r--r--src/java/README.md2
-rw-r--r--src/java/devcontainer-feature.json24
-rwxr-xr-xsrc/java/install.sh6
3 files changed, 29 insertions, 3 deletions
diff --git a/src/java/README.md b/src/java/README.md
index c409b34..a9ef433 100644
--- a/src/java/README.md
+++ b/src/java/README.md
@@ -18,7 +18,9 @@ Installs Java, SDKMAN! (if not installed), and needed dependencies.
| version | Select or enter a Java version to install | string | latest |
| jdkDistro | Select or enter a JDK distribution | string | ms |
| installGradle | Install Gradle, a build automation tool for multi-language software development | boolean | false |
+| gradleVersion | Select or enter a Gradle version | string | latest |
| installMaven | Install Maven, a management tool for Java | boolean | false |
+| mavenVersion | Select or enter a Maven version | string | latest |
## License
diff --git a/src/java/devcontainer-feature.json b/src/java/devcontainer-feature.json
index 19d6c13..c400fb6 100644
--- a/src/java/devcontainer-feature.json
+++ b/src/java/devcontainer-feature.json
@@ -1,6 +1,6 @@
{
"id": "java",
- "version": "1.0.11",
+ "version": "1.1.0",
"name": "Java (via SDKMAN!)",
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/java",
"description": "Installs Java, SDKMAN! (if not installed), and needed dependencies.",
@@ -33,10 +33,32 @@
"default": false,
"description": "Install Gradle, a build automation tool for multi-language software development"
},
+ "gradleVersion": {
+ "type": "string",
+ "proposals": [
+ "latest",
+ "7.5.1",
+ "6.9.3",
+ "5.6.4"
+ ],
+ "default": "latest",
+ "description": "Select or enter a Gradle version"
+ },
"installMaven": {
"type": "boolean",
"default": false,
"description": "Install Maven, a management tool for Java"
+ },
+ "mavenVersion": {
+ "type": "string",
+ "proposals": [
+ "latest",
+ "3.8.6",
+ "3.6.3",
+ "3.5.4"
+ ],
+ "default": "latest",
+ "description": "Select or enter a Maven version"
}
},
"buildArg": "_VSC_INSTALL_JAVA",
diff --git a/src/java/install.sh b/src/java/install.sh
index d2f735d..5928478 100755
--- a/src/java/install.sh
+++ b/src/java/install.sh
@@ -11,7 +11,9 @@
JAVA_VERSION=${VERSION:-"lts"}
INSTALL_GRADLE=${INSTALLGRADLE:-"false"}
+GRADLE_VERSION=${GRADLEVERSION:-"latest"}
INSTALL_MAVEN=${INSTALLMAVEN:-"false"}
+MAVEN_VERSION=${MAVENVERSION:-"latest"}
JDK_DISTRO=${JDKDISTRO}
export SDKMAN_DIR=${SDKMAN_DIR:-"/usr/local/sdkman"}
@@ -173,12 +175,12 @@ fi
# Install Gradle
if [[ "${INSTALL_GRADLE}" = "true" ]] && ! gradle --version > /dev/null; then
- sdk_install gradle latest
+ sdk_install gradle ${GRADLE_VERSION}
fi
# Install Maven
if [[ "${INSTALL_MAVEN}" = "true" ]] && ! mvn --version > /dev/null; then
- sdk_install maven latest
+ sdk_install maven ${MAVEN_VERSION}
fi
# Clean up