mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-20 14:55:50 +00:00
Merge branch 'spring-projects:main' into master
This commit is contained in:
commit
14dcd750e6
5 changed files with 29 additions and 49 deletions
|
@ -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'
|
|
|
@ -1,32 +1,25 @@
|
||||||
{
|
{
|
||||||
"name": "Petclinic",
|
"name": "Java",
|
||||||
"dockerFile": "Dockerfile",
|
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
|
||||||
"runArgs": [
|
"features": {
|
||||||
"--cap-add=SYS_PTRACE",
|
"ghcr.io/devcontainers/features/java:1": {
|
||||||
"--security-opt",
|
"version": "21-oracle",
|
||||||
"seccomp=unconfined",
|
"jdkDistro": "oracle"
|
||||||
"--mount",
|
},
|
||||||
"type=bind,source=${env:HOME}/.m2,target=/home/vscode/.m2",
|
"ghcr.io/devcontainers/features/azure-cli:1": {},
|
||||||
"--mount",
|
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
|
||||||
"type=bind,source=${env:HOME}/.gradle,target=/home/vscode/.gradle",
|
"ghcr.io/devcontainers/features/github-cli:1": {}
|
||||||
"--env",
|
},
|
||||||
"GRADLE_USER_HOME=/home/vscode/.gradle"
|
|
||||||
],
|
"customizations": {
|
||||||
"initializeCommand": "mkdir -p ${env:HOME}/.m2 ${env:HOME}/.gradle",
|
"vscode": {
|
||||||
"postCreateCommand": "sudo chown vscode:vscode /home/vscode/.m2 /home/vscode/.gradle",
|
"settings": {},
|
||||||
"remoteUser": "vscode",
|
"extensions": [
|
||||||
"features": {
|
"redhat.vscode-xml",
|
||||||
"docker-in-docker": "latest"
|
"visualstudioexptteam.vscodeintellicode",
|
||||||
},
|
"vscjava.vscode-java-pack"
|
||||||
"extensions": [
|
]
|
||||||
"vscjava.vscode-java-pack",
|
}
|
||||||
"redhat.vscode-xml",
|
},
|
||||||
"vmware.vscode-boot-dev-pack",
|
"remoteUser": "vscode"
|
||||||
"mhutchie.git-graph"
|
|
||||||
],
|
|
||||||
"forwardPorts": [8080],
|
|
||||||
"settings": {
|
|
||||||
"java.import.gradle.enabled": false,
|
|
||||||
"java.server.launchMode": "Standard"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
plugins {
|
plugins {
|
||||||
id 'java'
|
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 'io.spring.dependency-management' version '1.1.5'
|
||||||
id 'org.graalvm.buildtools.native' version '0.10.2'
|
id 'org.graalvm.buildtools.native' version '0.10.2'
|
||||||
id 'org.cyclonedx.bom' version '1.8.2'
|
id 'org.cyclonedx.bom' version '1.8.2'
|
||||||
|
|
8
pom.xml
8
pom.xml
|
@ -10,7 +10,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-parent</artifactId>
|
<artifactId>spring-boot-starter-parent</artifactId>
|
||||||
<version>3.3.0</version>
|
<version>3.3.2</version>
|
||||||
</parent>
|
</parent>
|
||||||
<name>petclinic</name>
|
<name>petclinic</name>
|
||||||
|
|
||||||
|
@ -221,7 +221,7 @@
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<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 -->
|
if a META-INF/build-info.properties file is present -->
|
||||||
<goals>
|
<goals>
|
||||||
<goal>build-info</goal>
|
<goal>build-info</goal>
|
||||||
|
@ -385,7 +385,7 @@
|
||||||
<build>
|
<build>
|
||||||
<pluginManagement>
|
<pluginManagement>
|
||||||
<plugins>
|
<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. -->
|
only. It has no influence on the Maven build itself. -->
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.eclipse.m2e</groupId>
|
<groupId>org.eclipse.m2e</groupId>
|
||||||
|
@ -443,4 +443,4 @@
|
||||||
</profile>
|
</profile>
|
||||||
</profiles>
|
</profiles>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -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`,
|
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.
|
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:
|
You can start MySQL or PostgreSQL locally with whatever installer works for your OS or use docker:
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue