Skip to content

Commit 1c6c50e

Browse files
chrmartiCopilot
andcommitted
Update Java dev container and Maven tooling
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 95ad767 commit 1c6c50e

8 files changed

Lines changed: 35 additions & 17 deletions

File tree

‎.classpath‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<attribute name="test" value="true"/>
1414
</attributes>
1515
</classpathentry>
16-
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11">
16+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-25">
1717
<attributes>
1818
<attribute name="maven.pomderived" value="true"/>
1919
</attributes>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"features": {
3+
"ghcr.io/devcontainers/features/java:1": {
4+
"version": "1.8.3",
5+
"resolved": "ghcr.io/devcontainers/features/java@sha256:61a839211feda1e2a1f10646648a948e733e4d98d770f3a4b6698a3c5fc92abe",
6+
"integrity": "sha256:61a839211feda1e2a1f10646648a948e733e4d98d770f3a4b6698a3c5fc92abe"
7+
}
8+
}
9+
}

‎.devcontainer/devcontainer.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
{
44
"name": "Java",
55
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6-
"image": "mcr.microsoft.com/devcontainers/java:1-21",
6+
"image": "mcr.microsoft.com/devcontainers/java:3-25-trixie",
77

88
"features": {
99
"ghcr.io/devcontainers/features/java:1": {
1010
"version": "none",
1111
"installMaven": "true",
12-
"mavenVersion": "3.8.6",
12+
"mavenVersion": "3.10.0",
1313
"installGradle": "false"
1414
}
1515
},

‎.github/workflows/continuous-integration.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1
1919
with:
2020
distribution: 'temurin'
21-
java-version: '17'
21+
java-version: '25'
2222
check-latest: false
2323
cache: 'maven'
2424
- name: Build with Maven
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
eclipse.preferences.version=1
2-
org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
3-
org.eclipse.jdt.core.compiler.compliance=11
2+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=25
3+
org.eclipse.jdt.core.compiler.compliance=25
44
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
55
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
66
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
77
org.eclipse.jdt.core.compiler.processAnnotations=disabled
8-
org.eclipse.jdt.core.compiler.release=disabled
9-
org.eclipse.jdt.core.compiler.source=11
8+
org.eclipse.jdt.core.compiler.release=enabled
9+
org.eclipse.jdt.core.compiler.source=25

‎README.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ Follow these steps to open this sample in a container using the VS Code Dev Cont
4040

4141
## Things to try
4242

43+
### Toolchain
44+
45+
This sample uses Java 25 on Debian 13 (Trixie), Maven 3.10.0, and JUnit Jupiter 6.1.3.
46+
Run `mvn verify` to compile and test the project, then `java -cp target/classes com.mycompany.app.App` to run it.
47+
The Maven compiler, editor settings, and CI all target Java 25.
48+
4349
Once you have this sample opened, you'll be able to work with it like you would locally.
4450

4551
Some things to try:

‎pom.xml‎

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,28 @@
99
<url>https://github.com/microsoft/vscode-remote-try-java</url>
1010
<dependencies>
1111
<dependency>
12-
<groupId>junit</groupId>
13-
<artifactId>junit</artifactId>
14-
<version>4.13.2</version>
12+
<groupId>org.junit.jupiter</groupId>
13+
<artifactId>junit-jupiter</artifactId>
14+
<version>6.1.3</version>
1515
<scope>test</scope>
1616
</dependency>
1717
</dependencies>
1818
<properties>
19-
<jdk.version>11</jdk.version>
20-
<maven.compiler.source>11</maven.compiler.source>
21-
<maven.compiler.target>11</maven.compiler.target>
19+
<maven.compiler.release>25</maven.compiler.release>
2220
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
2321
</properties>
2422
<build>
2523
<pluginManagement>
2624
<plugins>
25+
<plugin>
26+
<groupId>org.apache.maven.plugins</groupId>
27+
<artifactId>maven-compiler-plugin</artifactId>
28+
<version>3.16.0</version>
29+
</plugin>
2730
<plugin>
2831
<groupId>org.apache.maven.plugins</groupId>
2932
<artifactId>maven-surefire-plugin</artifactId>
30-
<version>3.0.0-M6</version>
33+
<version>3.6.0</version>
3134
</plugin>
3235
</plugins>
3336
</pluginManagement>

‎src/test/java/com/mycompany/app/AppTest.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package com.mycompany.app;
22

3-
import org.junit.Test;
3+
import org.junit.jupiter.api.Test;
44

5-
import static org.junit.Assert.assertTrue;
5+
import static org.junit.jupiter.api.Assertions.assertTrue;
66

77

88
public class AppTest {

0 commit comments

Comments
 (0)