Skip to content

Commit

Permalink
Merge pull request #69 from codecrafters-io/bump-java-version
Browse files Browse the repository at this point in the history
Bump Java version
  • Loading branch information
andy1li authored Oct 2, 2024
2 parents b0134a4 + db27839 commit d41dbab
Show file tree
Hide file tree
Showing 17 changed files with 46 additions and 36 deletions.
2 changes: 1 addition & 1 deletion compiled_starters/java/.codecrafters/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@

set -e # Exit on failure

exec java -jar /tmp/codecrafters-build-dns-server-java/java_dns.jar "$@"
exec java -jar /tmp/codecrafters-build-dns-server-java/codecrafters-dns-server.jar "$@"
5 changes: 2 additions & 3 deletions compiled_starters/java/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
java_dns.jar
target/*
*.jar
target/
.idea/
.idea/
2 changes: 1 addition & 1 deletion compiled_starters/java/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Time to move on to the next stage!

Note: This section is for stages 2 and beyond.

1. Ensure you have `java (21)` installed locally
1. Ensure you have `mvn` installed locally
1. Run `./your_program.sh` to run your program, which is implemented in
`src/main/java/Main.java`.
1. Commit your changes and run `git push origin master` to submit your solution
Expand Down
4 changes: 2 additions & 2 deletions compiled_starters/java/codecrafters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ debug: false
# Use this to change the Java version used to run your code
# on Codecrafters.
#
# Available versions: java-21
language_pack: java-21
# Available versions: java-23
language_pack: java-23
10 changes: 5 additions & 5 deletions compiled_starters/java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
<modelVersion>4.0.0</modelVersion>

<groupId>io.codecrafters</groupId>
<artifactId>build-your-own-dns</artifactId>
<artifactId>codecrafters-dns-server</artifactId>
<version>1.0</version>

<properties>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<maven.compiler.source>23</maven.compiler.source>
<maven.compiler.target>23</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>21</java.version>
<java.version>23</java.version>
</properties>

<build>
Expand All @@ -21,7 +21,7 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<finalName>java_dns</finalName> <!-- Please do not change this final artifact name-->
<finalName>codecrafters-dns-server</finalName> <!-- Please do not change this final artifact name-->
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
Expand Down
2 changes: 1 addition & 1 deletion compiled_starters/java/your_program.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ set -e # Exit early if any commands fail
#
# - Edit this to change how your program runs locally
# - Edit .codecrafters/run.sh to change how your program runs remotely
exec java -jar /tmp/codecrafters-build-dns-server-java/java_dns.jar "$@"
exec java -jar /tmp/codecrafters-build-dns-server-java/codecrafters-dns-server.jar "$@"
13 changes: 13 additions & 0 deletions dockerfiles/java-23.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# syntax=docker/dockerfile:1.7-labs
FROM maven:3.9.9-eclipse-temurin-23-alpine

# Ensures the container is re-built if dependency files change
ENV CODECRAFTERS_DEPENDENCY_FILE_PATHS="pom.xml"

WORKDIR /app

# .git & README.md are unique per-repository. We ignore them on first copy to prevent cache misses
COPY --exclude=.git --exclude=README.md . /app

# Install language-specific dependencies
RUN .codecrafters/compile.sh
2 changes: 1 addition & 1 deletion solutions/java/01-ux2/code/.codecrafters/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@

set -e # Exit on failure

exec java -jar /tmp/codecrafters-build-dns-server-java/java_dns.jar "$@"
exec java -jar /tmp/codecrafters-build-dns-server-java/codecrafters-dns-server.jar "$@"
5 changes: 2 additions & 3 deletions solutions/java/01-ux2/code/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
java_dns.jar
target/*
*.jar
target/
.idea/
.idea/
2 changes: 1 addition & 1 deletion solutions/java/01-ux2/code/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Time to move on to the next stage!

Note: This section is for stages 2 and beyond.

1. Ensure you have `java (21)` installed locally
1. Ensure you have `mvn` installed locally
1. Run `./your_program.sh` to run your program, which is implemented in
`src/main/java/Main.java`.
1. Commit your changes and run `git push origin master` to submit your solution
Expand Down
4 changes: 2 additions & 2 deletions solutions/java/01-ux2/code/codecrafters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ debug: false
# Use this to change the Java version used to run your code
# on Codecrafters.
#
# Available versions: java-21
language_pack: java-21
# Available versions: java-23
language_pack: java-23
10 changes: 5 additions & 5 deletions solutions/java/01-ux2/code/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
<modelVersion>4.0.0</modelVersion>

<groupId>io.codecrafters</groupId>
<artifactId>build-your-own-dns</artifactId>
<artifactId>codecrafters-dns-server</artifactId>
<version>1.0</version>

<properties>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<maven.compiler.source>23</maven.compiler.source>
<maven.compiler.target>23</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>21</java.version>
<java.version>23</java.version>
</properties>

<build>
Expand All @@ -21,7 +21,7 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<finalName>java_dns</finalName> <!-- Please do not change this final artifact name-->
<finalName>codecrafters-dns-server</finalName> <!-- Please do not change this final artifact name-->
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
Expand Down
2 changes: 1 addition & 1 deletion solutions/java/01-ux2/code/your_program.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ set -e # Exit early if any commands fail
#
# - Edit this to change how your program runs locally
# - Edit .codecrafters/run.sh to change how your program runs remotely
exec java -jar /tmp/codecrafters-build-dns-server-java/java_dns.jar "$@"
exec java -jar /tmp/codecrafters-build-dns-server-java/codecrafters-dns-server.jar "$@"
2 changes: 1 addition & 1 deletion starter_templates/java/code/.codecrafters/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@

set -e # Exit on failure

exec java -jar /tmp/codecrafters-build-dns-server-java/java_dns.jar "$@"
exec java -jar /tmp/codecrafters-build-dns-server-java/codecrafters-dns-server.jar "$@"
5 changes: 2 additions & 3 deletions starter_templates/java/code/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
java_dns.jar
target/*
*.jar
target/
.idea/
.idea/
10 changes: 5 additions & 5 deletions starter_templates/java/code/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
<modelVersion>4.0.0</modelVersion>

<groupId>io.codecrafters</groupId>
<artifactId>build-your-own-dns</artifactId>
<artifactId>codecrafters-dns-server</artifactId>
<version>1.0</version>

<properties>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<maven.compiler.source>23</maven.compiler.source>
<maven.compiler.target>23</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>21</java.version>
<java.version>23</java.version>
</properties>

<build>
Expand All @@ -21,7 +21,7 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<finalName>java_dns</finalName> <!-- Please do not change this final artifact name-->
<finalName>codecrafters-dns-server</finalName> <!-- Please do not change this final artifact name-->
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
Expand Down
2 changes: 1 addition & 1 deletion starter_templates/java/config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
attributes:
required_executable: java (21)
required_executable: mvn
user_editable_file: src/main/java/Main.java

0 comments on commit d41dbab

Please sign in to comment.