From 242b6f88c96464eb9797709d4bc148236ac6f1bc Mon Sep 17 00:00:00 2001 From: Michael Hoennig Date: Sat, 6 Jan 2024 18:11:24 +0100 Subject: [PATCH 1/3] make OWASP_API_KEY optionally --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 43ca4d22..4268446c 100644 --- a/build.gradle +++ b/build.gradle @@ -207,7 +207,7 @@ project.tasks.spotlessJava.dependsOn( // OWASP Dependency Security Test dependencyCheck { nvd { - apiKey = project.property('OWASP_API_KEY') // set it in ~/.gradle/gradle.properties + apiKey = project.properties['OWASP_API_KEY'] // set it in ~/.gradle/gradle.properties delay = 16000 } format = 'ALL' -- 2.39.5 From 0a996a9a8faab2ec9c7e3592fd001ed74306e261 Mon Sep 17 00:00:00 2001 From: Michael Hoennig Date: Sat, 6 Jan 2024 18:12:25 +0100 Subject: [PATCH 2/3] remove SDKMAN from README, JDK is now downloaded by Gradle Toolchain --- README.md | 32 ++++---------------------------- 1 file changed, 4 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 54667c20..a8c68da2 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,6 @@ For architecture consider the files in the `doc` and `adr` folder. - [Setting up the Development Environment](#setting-up-the-development-environment) - - [SDKMAN](#sdkman) - [PostgreSQL Server](#postgresql-server) - [Markdown](#markdown) - [Render Markdown embedded PlantUML](#render-markdown-embedded-plantuml) @@ -52,12 +51,10 @@ Everything is tested on _Ubuntu Linux 22.04_ and _MacOS Monterey (12.4)_. To be able to build and run the Java Spring Boot application, you need the following tools: - Docker 20.x (on MacOS you also need *Docker Desktop* or similar) -- PostgreSQL Server 15.5-bookworm +- optionally: PostgreSQL Server 15.5-bookworm (see instructions below to install and run in Docker) -- Java JDK at least recent enough to run Gradle - (JDK 17.x will be automatically installed by Gradle toolchain support) - -You also might need an IDE (e.g. *IntelliJ IDEA* or *Eclipse* or *VS Code* with *[STS](https://spring.io/tools)* and a GUI Frontend for *PostgreSQL* like *Postbird*. +- The matching Java JDK at will be automatically installed by Gradle toolchain support. +- You also might need an IDE (e.g. *IntelliJ IDEA* or *Eclipse* or *VS Code* with *[STS](https://spring.io/tools)* and a GUI Frontend for *PostgreSQL* like *Postbird*. If you have at least Docker, the Java JDK and Gradle installed in appropriate versions and in your `PATH`, then you can start like this: @@ -105,30 +102,9 @@ And to see the full, currently implemented, API, open http://localhost:8080/swag If you still need to install some of these tools, find some hints in the next chapters. -### SDKMAN - -*SdkMan* is not necessary, but helpful to install and switch between different versions of SDKs (Software-Development-Kits) and development tools in general, e.g. *JDK* and *Gradle*. -It is available for _Linux_ and _MacOS_, _WSL_, _Cygwin_, _Solaris_ and _FreeBSD_. - -You can get it from: https://sdkman.io/. - -**⚠** -Yeah, the `curl ... | bash` install method looks quite scary; -but in a development environment you're downloading executables all the time, -e.g. through `npm`, `Maven` or `Gradle` when downloading dependencies. -Thus, maybe you should at least use a separate Linux account for development. - -Once it's installed, you can install *JDK* and *Gradle*: - - sdk install java 17.0.3-tem - sdk install gradle - - sdk use java 17.0.3-tem # use this to switch between installed JDK versions - - ### PostgreSQL Server -You could use any PostgreSQL Server (from version 13 on) installed on your machine. +You could use any PostgreSQL Server (version 15) installed on your machine. You might amend the port and user settings in `src/main/resources/application.yml`, though. But the easiest way to run PostgreSQL is via Docker. -- 2.39.5 From 96ef4902078f5aec89325939898ce28d8aaf4d3d Mon Sep 17 00:00:00 2001 From: Michael Hoennig Date: Sat, 6 Jan 2024 18:23:13 +0100 Subject: [PATCH 3/3] code cleanup, removing commented code --- .../hs/office/bankaccount/HsOfficeBankAccountController.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/bankaccount/HsOfficeBankAccountController.java b/src/main/java/net/hostsharing/hsadminng/hs/office/bankaccount/HsOfficeBankAccountController.java index a9dd02b9..764d0a4a 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/bankaccount/HsOfficeBankAccountController.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/bankaccount/HsOfficeBankAccountController.java @@ -59,9 +59,6 @@ public class HsOfficeBankAccountController implements HsOfficeBankAccountsApi { final var saved = bankAccountRepo.save(entityToSave); -// em.persist(entityToSave); -// final var saved = entityToSave; -// em.flush(); final var uri = MvcUriComponentsBuilder.fromController(getClass()) -- 2.39.5