Commit c2e906e7 authored by xiezhi's avatar xiezhi

更换源

parent 86eca4ca
......@@ -2,7 +2,7 @@
"name": "Java Development Environment",
"image": "hb.eazytec-cloud.com/eazytec/eazydevelop-base:ubuntu",
"features": {
"https://gitlab.eazytec-cloud.com/eazydevelop-devcontainer-temp/devcontainer-features/java:feature_java_1.6.3_eazytec": {
"./java": {
"version": "17",
"installMaven": true,
"installGradle": true,
......
## License
For the Java Feature from this repository, see [NOTICE.txt](https://github.com/devcontainers/features/tree/main/src/java/NOTICE.txt) for licensing information on JDK distributions.
## OS Support
Debian/Ubuntu, RedHat Enterprise Linux, Fedora, Alma, and RockyLinux distributions with the `apt`, `yum`, `dnf`, or `microdnf` package manager installed.
`bash` is required to execute the `install.sh` script.
This source diff could not be displayed because it is too large. You can view the blob instead.
# Java (via SDKMAN!) (java)
Installs Java, SDKMAN! (if not installed), and needed dependencies.
## Example Usage
```json
"features": {
"ghcr.io/devcontainers/features/java:1": {}
}
```
## Options
| Options Id | Description | Type | Default Value |
|-----|-----|-----|-----|
| version | Select or enter a Java version to install | string | latest |
| additionalVersions | Enter additional Java versions, separated by commas. | string | - |
| 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 |
| installAnt | Install Ant, a software tool for automating software build processes | boolean | false |
| antVersion | Select or enter an Ant version | string | latest |
| installGroovy | Install Groovy, powerful, optionally typed and dynamic language with static-typing and static compilation capabilities | boolean | false |
| groovyVersion | Select or enter a Groovy version | string | latest |
## Customizations
### VS Code Extensions
- `vscjava.vscode-java-pack`
## License
For the Java Feature from this repository, see [NOTICE.txt](https://github.com/devcontainers/features/tree/main/src/java/NOTICE.txt) for licensing information on JDK distributions.
## OS Support
Debian/Ubuntu, RedHat Enterprise Linux, Fedora, Alma, and RockyLinux distributions with the `apt`, `yum`, `dnf`, or `microdnf` package manager installed.
`bash` is required to execute the `install.sh` script.
---
_Note: This file was auto-generated from the [devcontainer-feature.json](https://github.com/devcontainers/features/blob/main/src/java/devcontainer-feature.json). Add additional notes to a `NOTES.md`._
{
"id": "java",
"version": "1.6.3",
"name": "Java (via SDKMAN!)",
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/java",
"description": "Installs Java, SDKMAN! (if not installed), and needed dependencies.",
"options": {
"version": {
"type": "string",
"proposals": [
"latest",
"none",
"21",
"17",
"11",
"8"
],
"default": "latest",
"description": "Select or enter a Java version to install"
},
"additionalVersions": {
"type": "string",
"default": "",
"description": "Enter additional Java versions, separated by commas."
},
"jdkDistro": {
"type": "string",
"proposals": [
"ms",
"open",
"oracle",
"tem",
"amzn"
],
"default": "ms",
"description": "Select or enter a JDK distribution"
},
"installGradle": {
"type": "boolean",
"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"
},
"installAnt": {
"type": "boolean",
"default": false,
"description": "Install Ant, a software tool for automating software build processes"
},
"antVersion": {
"type": "string",
"proposals": [
"latest",
"1.10.12",
"1.9.15"
],
"default": "latest",
"description": "Select or enter an Ant version"
},
"installGroovy": {
"type": "boolean",
"default": false,
"description": "Install Groovy, powerful, optionally typed and dynamic language with static-typing and static compilation capabilities"
},
"groovyVersion": {
"type": "string",
"proposals": [
"latest",
"2.5.22",
"3.0.19",
"4.0.16"
],
"default": "latest",
"description": "Select or enter a Groovy version"
},
"useChineseMirror": {
"type": "boolean",
"default": true,
"description": "Use Chinese mirrors (Aliyun) for faster download in China"
},
"mirrorSource": {
"type": "string",
"proposals": [
"aliyun",
"tencent",
"huawei",
"official"
],
"default": "aliyun",
"description": "Select mirror source for SDKMAN downloads"
}
},
"customizations": {
"vscode": {
"extensions": [
"vscjava.vscode-java-pack"
],
"settings": {
"java.import.gradle.java.home": "/usr/local/sdkman/candidates/java/current"
}
}
},
"containerEnv": {
"SDKMAN_DIR": "/usr/local/sdkman",
"JAVA_HOME": "/usr/local/sdkman/candidates/java/current",
"PATH": "/usr/local/sdkman/bin:/usr/local/sdkman/candidates/java/current/bin:/usr/local/sdkman/candidates/gradle/current/bin:/usr/local/sdkman/candidates/maven/current/bin:/usr/local/sdkman/candidates/ant/current/bin:${PATH}"
},
"installsAfter": [
"ghcr.io/devcontainers/features/common-utils"
]
}
\ No newline at end of file
This diff is collapsed.
#!/usr/bin/env bash
# Wrapper function that also installs JDK 11 if JDK 8 is selected since this is required for the Java extension
set -e
JAVA_VERSION="${1:-"default"}"
SDKMAN_DIR="${2:-"/usr/local/sdkman"}"
USERNAME="${USERNAME:-"${_REMOTE_USER:-"automatic"}"}"
UPDATE_RC="${4:-"true"}"
ADDITIONAL_JAVA_VERSION="11"
cd "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
chmod +x install.sh
is_jdk_8="false"
if echo "${JAVA_VERSION}" | grep -E '^8([\s\.]|$)' > /dev/null 2>&1; then
is_jdk_8="true"
fi
# If the user selected JDK 8, install the JDK 11 as well since this is needed by the Java extension
if [ "${is_jdk_8}" = "true" ]; then
echo "(*) Installing JDK ${ADDITIONAL_JAVA_VERSION} as Java VS Code extension requires a recent JDK..."
./install.sh "${ADDITIONAL_JAVA_VERSION}" "${SDKMAN_DIR}" "${USERNAME}" "${UPDATE_RC}"
jdk_11_folder="$(ls --format=single-column ${SDKMAN_DIR}/candidates/java | grep -oE -m 1 '11\..+')"
ln -s "${SDKMAN_DIR}/candidates/java/${jdk_11_folder}" /extension-java-home
# Determine the appropriate non-root user
username=""
possible_users=("vscode" "node" "codespace" "$(awk -v val=1000 -F ":" '$3==val{print $1}' /etc/passwd)")
for current_user in "${POSSIBLE_USERS[@]}"; do
if id -u ${current_user} > /dev/null 2>&1; then
username=${current_user}
break
fi
done
if [ "${username}" = "" ]; then
username=root
fi
else
ln -s ${SDKMAN_DIR}/candidates/java/current /extension-java-home
fi
echo "(*) Installing JDK ${JAVA_VERSION}..."
./install.sh "${JAVA_VERSION}" "${SDKMAN_DIR}" "${USERNAME}" "${UPDATE_RC}"
if [ "${is_jdk_8}" = "true" ]; then
# Set current and default version to last SDK installed
jdk_full_version="$(ls --format=single-column "${SDKMAN_DIR}/candidates/java" | sort -rV | grep -oE -m 1 "${JAVA_VERSION}\\..+" )"
echo "(*) Setting default JDK to ${jdk_full_version}..."
. ${SDKMAN_DIR}/bin/sdkman-init.sh
sdk use java "${jdk_full_version}"
sdk default java "${jdk_full_version}"
fi
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment