Skip to content
This repository was archived by the owner on Nov 30, 2023. It is now read-only.

Commit 5d0cbb0

Browse files
authored
Merge pull request #19 from testforstephen/jinbo_java12
Add java 12 container definition
2 parents 03faa53 + 25bc9fb commit 5d0cbb0

File tree

14 files changed

+279
-0
lines changed

14 files changed

+279
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#-----------------------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See LICENSE in the project root for license information.
4+
#-----------------------------------------------------------------------------------------
5+
6+
FROM maven:3-jdk-12
7+
8+
# Install git, process tools
9+
RUN yum update -y && yum install -y git procps unzip
10+
11+
# Install Gradle
12+
ENV GRADLE_HOME /opt/gradle
13+
ENV GRADLE_VERSION 5.4
14+
ARG GRADLE_DOWNLOAD_SHA256=c8c17574245ecee9ed7fe4f6b593b696d1692d1adbfef425bef9b333e3a0e8de
15+
RUN curl -SL --output gradle.zip "https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-bin.zip" \
16+
&& echo "${GRADLE_DOWNLOAD_SHA256} *gradle.zip" | sha256sum --check - \
17+
&& unzip gradle.zip \
18+
&& rm gradle.zip \
19+
&& mv "gradle-${GRADLE_VERSION}" "${GRADLE_HOME}/" \
20+
&& ln -s "${GRADLE_HOME}/bin/gradlec" /usr/bin/gradle
21+
22+
# Clean yum cache
23+
RUN yum clean all
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"name": "Java 12",
3+
"dockerFile": "Dockerfile",
4+
"extensions": [
5+
"vscjava.vscode-java-pack"
6+
]
7+
}

containers/java-12/.npmignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
README.md
2+
test-project
3+
.vscode
4+
.npmignore
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"configurations": [
3+
{
4+
"type": "java",
5+
"name": "Launch App",
6+
"request": "launch",
7+
"cwd": "${workspaceFolder}/test-project",
8+
"console": "internalConsole",
9+
"stopOnEntry": false,
10+
"mainClass": "com.mycompany.app.App",
11+
"args": "",
12+
"projectName": "my-app"
13+
}
14+
]
15+
}

containers/java-12/README.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Java 12
2+
3+
## Summary
4+
5+
*Develop Java applications. Includes the JDK 12, Maven and Gradle build tools.*
6+
7+
| Metadata | Value |
8+
|----------|-------|
9+
| *Contributors* | The VS Code Java Team |
10+
| *Definition type* | Dockerfile |
11+
| *Languages, platforms* | Java, Maven, Gradle |
12+
13+
## Using this definition with an existing folder
14+
15+
Note that only the integrated terminal is supported by the Remote - Containers extension. You may need to modify `launch.json` configurations to include the following value if an external console is used.
16+
17+
```json
18+
"console": "integratedTerminal"
19+
```
20+
21+
Beyond that, just follow these steps to use the definition:
22+
23+
1. If this is your first time using a development container, please follow the [getting started steps](https://aka.ms/vscode-remote/containers/getting-started) to set up your machine.
24+
25+
2. To use VS Code's copy of this definition:
26+
1. Start VS Code and open your project folder.
27+
2. Press <kbd>F1</kbd> select and **Remote-Containers: Create Container Configuration File...** from the command palette.
28+
3. Select the Java 12 definition.
29+
30+
3. To use latest-and-greatest copy of this definition from the repository:
31+
1. Clone this repository.
32+
2. Copy the contents of `containers/java-12/.devcontainer` to the root of your project folder.
33+
3. Start VS Code and open your project folder.
34+
35+
4. After following step 2 or 3, the contents of the `.devcontainer` folder in your project can be adapted to meet your needs.
36+
37+
5. Finally, press <kbd>F1</kbd> and run **Remote-Containers: Reopen Folder in Container** to start using the definition.
38+
39+
## Testing the definition
40+
41+
This definition includes some test code that will help you verify it is working as expected on your system. Follow these steps:
42+
43+
1. If this is your first time using a development container, please follow the [getting started steps](https://aka.ms/vscode-remote/containers/getting-started) to set up your machine.
44+
2. Clone this repository.
45+
3. Start VS Code, press <kbd>F1</kbd>, and select **Remote-Containers: Open Folder in Container...**
46+
4. Select the `containers/java-12` folder.
47+
5. After the folder has opened in the container, press <kbd>F5</kbd> to start the project.
48+
6. You should see "Hello Weekday" in the Debug Console after the program executes.
49+
7. From here, you can add breakpoints or edit the contents of the `test-project` folder to do further testing.
50+
51+
## License
52+
53+
Copyright (c) Microsoft Corporation. All rights reserved.
54+
55+
Licensed under the MIT License. See [LICENSE](https://github.com/Microsoft/vscode-dev-containers/blob/master/LICENSE).
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" output="target/classes" path="src/main/java">
4+
<attributes>
5+
<attribute name="optional" value="true"/>
6+
<attribute name="maven.pomderived" value="true"/>
7+
</attributes>
8+
</classpathentry>
9+
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
10+
<attributes>
11+
<attribute name="optional" value="true"/>
12+
<attribute name="maven.pomderived" value="true"/>
13+
<attribute name="test" value="true"/>
14+
</attributes>
15+
</classpathentry>
16+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-12">
17+
<attributes>
18+
<attribute name="maven.pomderived" value="true"/>
19+
</attributes>
20+
</classpathentry>
21+
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
22+
<attributes>
23+
<attribute name="maven.pomderived" value="true"/>
24+
</attributes>
25+
</classpathentry>
26+
<classpathentry kind="src" path="target/generated-sources/annotations">
27+
<attributes>
28+
<attribute name="optional" value="true"/>
29+
<attribute name="maven.pomderived" value="true"/>
30+
<attribute name="ignore_optional_problems" value="true"/>
31+
<attribute name="m2e-apt" value="true"/>
32+
</attributes>
33+
</classpathentry>
34+
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
35+
<attributes>
36+
<attribute name="optional" value="true"/>
37+
<attribute name="maven.pomderived" value="true"/>
38+
<attribute name="ignore_optional_problems" value="true"/>
39+
<attribute name="m2e-apt" value="true"/>
40+
<attribute name="test" value="true"/>
41+
</attributes>
42+
</classpathentry>
43+
<classpathentry kind="output" path="target/classes"/>
44+
</classpath>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
target
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>my-app</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.m2e.core.maven2Builder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
</buildSpec>
19+
<natures>
20+
<nature>org.eclipse.jdt.core.javanature</nature>
21+
<nature>org.eclipse.m2e.core.maven2Nature</nature>
22+
</natures>
23+
</projectDescription>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
eclipse.preferences.version=1
2+
org.eclipse.jdt.apt.aptEnabled=false
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
eclipse.preferences.version=1
2+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=12
3+
org.eclipse.jdt.core.compiler.compliance=12
4+
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=enabled
5+
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
6+
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
7+
org.eclipse.jdt.core.compiler.processAnnotations=disabled
8+
org.eclipse.jdt.core.compiler.release=disabled
9+
org.eclipse.jdt.core.compiler.source=12

0 commit comments

Comments
 (0)