Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to Spring boot 3 #23

Merged
merged 3 commits into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: "11"
java-version: "17"
distribution: "adopt"
- name: Build with Maven
run: mvn --batch-mode --update-snapshots clean package -P melody
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '11'
java-version: '17'
distribution: 'adopt'
- name: Build with Maven
run: mvn --batch-mode --update-snapshots clean package
Expand Down
24 changes: 23 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,26 @@ config/
hs_err*.log
application.properties
ghs.sqlite
gloomhavensecretariat
gloomhavensecretariat

# IDEs and editors
.idea/
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# Visual Studio Code
.vscode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*

# System files
.DS_Store
Thumbs.db
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM maven:3.8.7-eclipse-temurin-11 as builder
FROM maven:3-eclipse-temurin-17 as builder
ENV HOME=/usr/app
RUN mkdir -p $HOME
WORKDIR $HOME
Expand All @@ -7,7 +7,7 @@ RUN mvn verify --fail-never
ADD . $HOME
RUN mvn package

FROM eclipse-temurin:11
FROM eclipse-temurin:17
WORKDIR /root
COPY --from=builder /usr/app/target/ghs-server*.jar /root/
ENTRYPOINT java -jar /root/ghs-server-*.jar -Djava.awt.headless=true
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ This will run a basic server for a single game code (e.g. for a group, you can s

### Quickstart

1. Install *Java 11* (or higher) *Runtime Environment*: [Installation Guide for different OS'](https://adoptium.net/en-GB/installation/)
1. Install *Java 17* (or higher) (***Requirement changes with newer version!***) *Runtime Environment*: [Installation Guide for different OS'](https://adoptium.net/en-GB/installation/)
2. Download the appropriate latest `jar` executable from the [latest release](https://github.com/Lurkars/ghs-server/releases/latest) assets.
3. Execute the `jar` file (should be working automatically with your Java Runtime Environment)
4. You should see a similar window:<br><img width="776" alt="image" src="./resources/Screenshot1.png">
Expand Down
7 changes: 3 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>11</java.version>
<revision>0.79.5</revision>
<java.version>17</java.version>
<revision>0.80.0</revision>
</properties>

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.8</version>
<version>3.1.5</version>
<relativePath />
</parent>

Expand All @@ -37,7 +37,6 @@
<dependency>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
<version>3.43.2.1</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,14 @@ protected ResponseEntity<Object> handleResponseEntityStatusException(ResponseSta

JsonObject errorResponse = new JsonObject();
errorResponse.addProperty("timestamp", Instant.now().toString());
errorResponse.addProperty("status", exception.getStatus().value());
errorResponse.addProperty("error", exception.getStatus().getReasonPhrase());
errorResponse.addProperty("status", exception.getStatusCode().value());
// errorResponse.addProperty("error", exception.getStatus().getReasonPhrase());
if (StringUtils.hasText(exception.getReason())) {
errorResponse.addProperty("reason", exception.getReason());
}

return handleExceptionInternal(exception, gson.toJson(errorResponse), headers, exception.getStatus(), request);
return handleExceptionInternal(exception, gson.toJson(errorResponse), headers, exception.getStatusCode(),
request);
}

}
Loading