Merge branch 'spring-projects:main' into master

This commit is contained in:
Barry Matheney 2024-08-22 08:32:47 -04:00 committed by GitHub
commit 14dcd750e6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 29 additions and 49 deletions

View file

@ -1,13 +0,0 @@
ARG VARIANT=17-bullseye
FROM mcr.microsoft.com/vscode/devcontainers/java:0-${VARIANT}
ARG NODE_VERSION="none"
RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
ARG USER=vscode
VOLUME /home/$USER/.m2
VOLUME /home/$USER/.gradle
ARG JAVA_VERSION=17.0.7-ms
RUN sudo mkdir /home/$USER/.m2 /home/$USER/.gradle && sudo chown $USER:$USER /home/$USER/.m2 /home/$USER/.gradle
RUN bash -lc '. /usr/local/sdkman/bin/sdkman-init.sh && sdk install java $JAVA_VERSION && sdk use java $JAVA_VERSION'

View file

@ -1,32 +1,25 @@
{
"name": "Petclinic",
"dockerFile": "Dockerfile",
"runArgs": [
"--cap-add=SYS_PTRACE",
"--security-opt",
"seccomp=unconfined",
"--mount",
"type=bind,source=${env:HOME}/.m2,target=/home/vscode/.m2",
"--mount",
"type=bind,source=${env:HOME}/.gradle,target=/home/vscode/.gradle",
"--env",
"GRADLE_USER_HOME=/home/vscode/.gradle"
],
"initializeCommand": "mkdir -p ${env:HOME}/.m2 ${env:HOME}/.gradle",
"postCreateCommand": "sudo chown vscode:vscode /home/vscode/.m2 /home/vscode/.gradle",
"remoteUser": "vscode",
"features": {
"docker-in-docker": "latest"
},
"extensions": [
"vscjava.vscode-java-pack",
"redhat.vscode-xml",
"vmware.vscode-boot-dev-pack",
"mhutchie.git-graph"
],
"forwardPorts": [8080],
"settings": {
"java.import.gradle.enabled": false,
"java.server.launchMode": "Standard"
}
"name": "Java",
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"features": {
"ghcr.io/devcontainers/features/java:1": {
"version": "21-oracle",
"jdkDistro": "oracle"
},
"ghcr.io/devcontainers/features/azure-cli:1": {},
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers/features/github-cli:1": {}
},
"customizations": {
"vscode": {
"settings": {},
"extensions": [
"redhat.vscode-xml",
"visualstudioexptteam.vscodeintellicode",
"vscjava.vscode-java-pack"
]
}
},
"remoteUser": "vscode"
}

View file

@ -1,6 +1,6 @@
plugins {
id 'java'
id 'org.springframework.boot' version '3.3.0'
id 'org.springframework.boot' version '3.3.2'
id 'io.spring.dependency-management' version '1.1.5'
id 'org.graalvm.buildtools.native' version '0.10.2'
id 'org.cyclonedx.bom' version '1.8.2'

View file

@ -10,7 +10,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.3.0</version>
<version>3.3.2</version>
</parent>
<name>petclinic</name>
@ -221,7 +221,7 @@
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<!-- Spring Boot Actuator displays build-related information
<!-- Spring Boot Actuator displays build-related information
if a META-INF/build-info.properties file is present -->
<goals>
<goal>build-info</goal>
@ -385,7 +385,7 @@
<build>
<pluginManagement>
<plugins>
<!-- This plugin's configuration is used to store Eclipse m2e settings
<!-- This plugin's configuration is used to store Eclipse m2e settings
only. It has no influence on the Maven build itself. -->
<plugin>
<groupId>org.eclipse.m2e</groupId>
@ -443,4 +443,4 @@
</profile>
</profiles>
</project>
</project>

View file

@ -47,7 +47,7 @@ In its default configuration, Petclinic uses an in-memory database (H2) which
gets populated at startup with data. The h2 console is exposed at `http://localhost:8080/h2-console`,
and it is possible to inspect the content of the database using the `jdbc:h2:mem:<uuid>` URL. The UUID is printed at startup to the console.
A similar setup is provided for MySQL and PostgreSQL if a persistent database configuration is needed. Note that whenever the database type changes, the app needs to run with a different profile: `spring.profiles.active=mysql` for MySQL or `spring.profiles.active=postgres` for PostgreSQL.
A similar setup is provided for MySQL and PostgreSQL if a persistent database configuration is needed. Note that whenever the database type changes, the app needs to run with a different profile: `spring.profiles.active=mysql` for MySQL or `spring.profiles.active=postgres` for PostgreSQL. See the [Spring Boot documentation](https://docs.spring.io/spring-boot/how-to/properties-and-configuration.html#howto.properties-and-configuration.set-active-spring-profiles) for more detail on how to set the active profile.
You can start MySQL or PostgreSQL locally with whatever installer works for your OS or use docker: