From bdac92bc39e989b27f142ac94b85e17bb979ada9 Mon Sep 17 00:00:00 2001 From: Sven Efftinge Date: Tue, 10 Sep 2019 18:20:19 +0000 Subject: [PATCH 01/41] gitpod config --- .gitpod.yml | 8 ++++++++ Dockerfile | 3 +++ readme.md | 19 +++++++++++++------ 3 files changed, 24 insertions(+), 6 deletions(-) create mode 100644 .gitpod.yml create mode 100644 Dockerfile diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 00000000..ca7f3a8e --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,8 @@ +# exposed ports +ports: +- port: 8080 + onOpen: open-preview +# start up tasks +tasks: +- init: ./mvnw package -DskipTests + command: java -jar target/*.jar diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..713d12e6 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,3 @@ +FROM gitpod/workspace-full + +# add your tools here ... diff --git a/readme.md b/readme.md index 34c8e8b8..5031a88c 100644 --- a/readme.md +++ b/readme.md @@ -1,10 +1,17 @@ -# Spring PetClinic Sample Application [![Build Status](https://travis-ci.org/spring-projects/spring-petclinic.png?branch=master)](https://travis-ci.org/spring-projects/spring-petclinic/) +# Spring PetClinic Sample application [![Build Status](https://travis-ci.org/spring-projects/spring-petclinic.png?branch=master)](https://travis-ci.org/spring-projects/spring-petclinic/) [![setup automated](https://img.shields.io/badge/setup-automated-blue?logo=gitpod)](https://gitpod.io/from-referrer/) + Deploy this sample application to Pivotal Web Services: Push +Start coding in a [ready-to-code development environment](https://www.gitpod.io): + + + Push + + ## Understanding the Spring Petclinic application with a few diagrams See the presentation here @@ -53,7 +60,7 @@ Further documentation is provided [here](https://github.com/spring-projects/spri The following items should be installed in your system: * Java 8 or newer. * git command line tool (https://help.github.com/articles/set-up-git) -* Your preferred IDE +* Your preferred IDE * Eclipse with the m2e plugin. Note: when m2e is available, there is an m2 icon in `Help -> About` dialog. If m2e is not there, just follow the install process here: https://www.eclipse.org/m2e/ * [Spring Tools Suite](https://spring.io/tools) (STS) @@ -93,9 +100,9 @@ Visit [http://localhost:8080](http://localhost:8080) in your browser. |Spring Boot Configuration | Class or Java property files | |--------------------------|---| -|The Main Class | [PetClinicApplication](https://github.com/spring-projects/spring-petclinic/blob/master/src/main/java/org/springframework/samples/petclinic/PetClinicApplication.java) | -|Properties Files | [application.properties](https://github.com/spring-projects/spring-petclinic/blob/master/src/main/resources) | -|Caching | [CacheConfiguration](https://github.com/spring-projects/spring-petclinic/blob/master/src/main/java/org/springframework/samples/petclinic/system/CacheConfiguration.java) | +|The Main Class | [PetClinicApplication](./src/main/java/org/springframework/samples/petclinic/PetClinicApplication.java) | +|Properties Files | [application.properties](./src/main/resources/application.properties) | +|Caching | [CacheConfiguration](./src/main/java/org/springframework/samples/petclinic/system/CacheConfiguration.java) | ## Interesting Spring Petclinic branches and forks @@ -130,7 +137,7 @@ The Spring PetClinic sample application is released under version 2.0 of the [Ap [spring-petclinic]: https://github.com/spring-projects/spring-petclinic [spring-framework-petclinic]: https://github.com/spring-petclinic/spring-framework-petclinic -[spring-petclinic-angularjs]: https://github.com/spring-petclinic/spring-petclinic-angularjs +[spring-petclinic-angularjs]: https://github.com/spring-petclinic/spring-petclinic-angularjs [javaconfig branch]: https://github.com/spring-petclinic/spring-framework-petclinic/tree/javaconfig [spring-petclinic-angular]: https://github.com/spring-petclinic/spring-petclinic-angular [spring-petclinic-microservices]: https://github.com/spring-petclinic/spring-petclinic-microservices From 0c5aed05cb3f4b0ed2cea1b5b70e9cae80244222 Mon Sep 17 00:00:00 2001 From: Sven Efftinge Date: Fri, 1 Nov 2019 08:45:28 +0000 Subject: [PATCH 02/41] exclude project files --- .vscode/settings.json | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index c5f3f6b9..53a61f3d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,9 @@ { - "java.configuration.updateBuildConfiguration": "interactive" + "java.configuration.updateBuildConfiguration": "interactive", + "files.exclude": { + "**/.classpath": true, + "**/.project": true, + "**/.settings": true, + "**/.factorypath": true + } } \ No newline at end of file From 6cd36b8eeb86b922820627baa7a8b52e4e49eb07 Mon Sep 17 00:00:00 2001 From: Sven Efftinge Date: Wed, 4 Dec 2019 09:46:57 +0000 Subject: [PATCH 03/41] Updated readme --- readme.md | 131 +----------------------------------------------------- 1 file changed, 1 insertion(+), 130 deletions(-) diff --git a/readme.md b/readme.md index 5031a88c..42b64fc5 100644 --- a/readme.md +++ b/readme.md @@ -1,10 +1,4 @@ -# Spring PetClinic Sample application [![Build Status](https://travis-ci.org/spring-projects/spring-petclinic.png?branch=master)](https://travis-ci.org/spring-projects/spring-petclinic/) [![setup automated](https://img.shields.io/badge/setup-automated-blue?logo=gitpod)](https://gitpod.io/from-referrer/) - -Deploy this sample application to Pivotal Web Services: - - - Push - +# Spring PetClinic Sample application [![setup automated](https://img.shields.io/badge/setup-automated-blue?logo=gitpod)](https://gitpod.io/from-referrer/) Start coding in a [ready-to-code development environment](https://www.gitpod.io): @@ -15,19 +9,6 @@ Start coding in a [ready-to-code development environment](https://www.gitpod.io) ## Understanding the Spring Petclinic application with a few diagrams See the presentation here -## Running petclinic locally -Petclinic is a [Spring Boot](https://spring.io/guides/gs/spring-boot) application built using [Maven](https://spring.io/guides/gs/maven/). You can build a jar file and run it from the command line: - - -``` -git clone https://github.com/spring-projects/spring-petclinic.git -cd spring-petclinic -./mvnw package -java -jar target/*.jar -``` - -You can then access petclinic here: http://localhost:8080/ - petclinic-screenshot Or you can run it from Maven directly using the Spring Boot Maven plugin. If you do this it will pick up changes that you make in the project immediately (changes to Java source files require a compile as well - most people use an IDE for this): @@ -35,113 +16,3 @@ Or you can run it from Maven directly using the Spring Boot Maven plugin. If you ``` ./mvnw spring-boot:run ``` - -## In case you find a bug/suggested improvement for Spring Petclinic -Our issue tracker is available here: https://github.com/spring-projects/spring-petclinic/issues - - -## Database configuration - -In its default configuration, Petclinic uses an in-memory database (HSQLDB) which -gets populated at startup with data. A similar setup is provided for MySql in case a persistent database configuration is needed. -Note that whenever the database type is changed, the app needs to be run with a different profile: `spring.profiles.active=mysql` for MySql. - -You could start MySql locally with whatever installer works for your OS, or with docker: - -``` -docker run -e MYSQL_ROOT_PASSWORD=petclinic -e MYSQL_DATABASE=petclinic -p 3306:3306 mysql:5.7.8 -``` - -Further documentation is provided [here](https://github.com/spring-projects/spring-petclinic/blob/master/src/main/resources/db/mysql/petclinic_db_setup_mysql.txt). - -## Working with Petclinic in your IDE - -### Prerequisites -The following items should be installed in your system: -* Java 8 or newer. -* git command line tool (https://help.github.com/articles/set-up-git) -* Your preferred IDE - * Eclipse with the m2e plugin. Note: when m2e is available, there is an m2 icon in `Help -> About` dialog. If m2e is - not there, just follow the install process here: https://www.eclipse.org/m2e/ - * [Spring Tools Suite](https://spring.io/tools) (STS) - * IntelliJ IDEA - * [VS Code](https://code.visualstudio.com) - -### Steps: - -1) On the command line -``` -git clone https://github.com/spring-projects/spring-petclinic.git -``` -2) Inside Eclipse or STS -``` -File -> Import -> Maven -> Existing Maven project -``` - -Then either build on the command line `./mvnw generate-resources` or using the Eclipse launcher (right click on project and `Run As -> Maven install`) to generate the css. Run the application main method by right clicking on it and choosing `Run As -> Java Application`. - -3) Inside IntelliJ IDEA - -In the main menu, choose `File -> Open` and select the Petclinic [pom.xml](pom.xml). Click on the `Open` button. - -CSS files are generated from the Maven build. You can either build them on the command line `./mvnw generate-resources` -or right click on the `spring-petclinic` project then `Maven -> Generates sources and Update Folders`. - -A run configuration named `PetClinicApplication` should have been created for you if you're using a recent Ultimate -version. Otherwise, run the application by right clicking on the `PetClinicApplication` main class and choosing -`Run 'PetClinicApplication'`. - -4) Navigate to Petclinic - -Visit [http://localhost:8080](http://localhost:8080) in your browser. - - -## Looking for something in particular? - -|Spring Boot Configuration | Class or Java property files | -|--------------------------|---| -|The Main Class | [PetClinicApplication](./src/main/java/org/springframework/samples/petclinic/PetClinicApplication.java) | -|Properties Files | [application.properties](./src/main/resources/application.properties) | -|Caching | [CacheConfiguration](./src/main/java/org/springframework/samples/petclinic/system/CacheConfiguration.java) | - -## Interesting Spring Petclinic branches and forks - -The Spring Petclinic master branch in the main [spring-projects](https://github.com/spring-projects/spring-petclinic) -GitHub org is the "canonical" implementation, currently based on Spring Boot and Thymeleaf. There are -[quite a few forks](https://spring-petclinic.github.io/docs/forks.html) in a special GitHub org -[spring-petclinic](https://github.com/spring-petclinic). If you have a special interest in a different technology stack -that could be used to implement the Pet Clinic then please join the community there. - - -## Interaction with other open source projects - -One of the best parts about working on the Spring Petclinic application is that we have the opportunity to work in direct contact with many Open Source projects. We found some bugs/suggested improvements on various topics such as Spring, Spring Data, Bean Validation and even Eclipse! In many cases, they've been fixed/implemented in just a few days. -Here is a list of them: - -| Name | Issue | -|------|-------| -| Spring JDBC: simplify usage of NamedParameterJdbcTemplate | [SPR-10256](https://jira.springsource.org/browse/SPR-10256) and [SPR-10257](https://jira.springsource.org/browse/SPR-10257) | -| Bean Validation / Hibernate Validator: simplify Maven dependencies and backward compatibility |[HV-790](https://hibernate.atlassian.net/browse/HV-790) and [HV-792](https://hibernate.atlassian.net/browse/HV-792) | -| Spring Data: provide more flexibility when working with JPQL queries | [DATAJPA-292](https://jira.springsource.org/browse/DATAJPA-292) | - - -# Contributing - -The [issue tracker](https://github.com/spring-projects/spring-petclinic/issues) is the preferred channel for bug reports, features requests and submitting pull requests. - -For pull requests, editor preferences are available in the [editor config](.editorconfig) for easy use in common text editors. Read more and download plugins at . If you have not previously done so, please fill out and submit the [Contributor License Agreement](https://cla.pivotal.io/sign/spring). - -# License - -The Spring PetClinic sample application is released under version 2.0 of the [Apache License](https://www.apache.org/licenses/LICENSE-2.0). - -[spring-petclinic]: https://github.com/spring-projects/spring-petclinic -[spring-framework-petclinic]: https://github.com/spring-petclinic/spring-framework-petclinic -[spring-petclinic-angularjs]: https://github.com/spring-petclinic/spring-petclinic-angularjs -[javaconfig branch]: https://github.com/spring-petclinic/spring-framework-petclinic/tree/javaconfig -[spring-petclinic-angular]: https://github.com/spring-petclinic/spring-petclinic-angular -[spring-petclinic-microservices]: https://github.com/spring-petclinic/spring-petclinic-microservices -[spring-petclinic-reactjs]: https://github.com/spring-petclinic/spring-petclinic-reactjs -[spring-petclinic-graphql]: https://github.com/spring-petclinic/spring-petclinic-graphql -[spring-petclinic-kotlin]: https://github.com/spring-petclinic/spring-petclinic-kotlin -[spring-petclinic-rest]: https://github.com/spring-petclinic/spring-petclinic-rest From 292d48abebfe7b49cdc7efb6994bcece71769e6a Mon Sep 17 00:00:00 2001 From: Sven Efftinge Date: Sat, 1 Feb 2020 11:53:36 +0100 Subject: [PATCH 04/41] updated badge --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 42b64fc5..9dca29d4 100644 --- a/readme.md +++ b/readme.md @@ -1,4 +1,4 @@ -# Spring PetClinic Sample application [![setup automated](https://img.shields.io/badge/setup-automated-blue?logo=gitpod)](https://gitpod.io/from-referrer/) +# Spring PetClinic Sample application [![setup automated](https://img.shields.io/badge/Gitpod-ready_to_code-blue?logo=gitpod)](https://gitpod.io/from-referrer/) Start coding in a [ready-to-code development environment](https://www.gitpod.io): From c5f06bd6909926bd71fda00fb62be1a4b843b026 Mon Sep 17 00:00:00 2001 From: Sven Efftinge Date: Fri, 21 Aug 2020 16:15:28 +0000 Subject: [PATCH 05/41] removed mandatory --- .../java/org/springframework/samples/petclinic/model/Person.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/org/springframework/samples/petclinic/model/Person.java b/src/main/java/org/springframework/samples/petclinic/model/Person.java index 883376fb..e4a3763f 100644 --- a/src/main/java/org/springframework/samples/petclinic/model/Person.java +++ b/src/main/java/org/springframework/samples/petclinic/model/Person.java @@ -28,7 +28,6 @@ public class Person extends BaseEntity { @Column(name = "first_name") - @NotEmpty private String firstName; @Column(name = "last_name") From f3aa31f7bfc37e7e453286d82f96f378ef250b83 Mon Sep 17 00:00:00 2001 From: Sven Efftinge Date: Tue, 10 Nov 2020 14:24:23 +0100 Subject: [PATCH 06/41] Update .gitpod.yml --- .gitpod.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitpod.yml b/.gitpod.yml index ca7f3a8e..30b139b1 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -1,8 +1,9 @@ -# exposed ports -ports: -- port: 8080 - onOpen: open-preview # start up tasks tasks: - init: ./mvnw package -DskipTests command: java -jar target/*.jar + +# exposed ports +ports: +- port: 8080 + onOpen: open-preview From 5841e8925d7c21605b016d8d3e730c84af5766e2 Mon Sep 17 00:00:00 2001 From: Sven Efftinge Date: Wed, 3 Mar 2021 16:19:45 +0000 Subject: [PATCH 07/41] [config] add java extension --- .gitpod.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitpod.yml b/.gitpod.yml index 30b139b1..2eb7b13d 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -1,4 +1,4 @@ -# start up tasks + tasks: - init: ./mvnw package -DskipTests command: java -jar target/*.jar @@ -7,3 +7,7 @@ tasks: ports: - port: 8080 onOpen: open-preview + +vscode: + extensions: + - redhat.java \ No newline at end of file From 5e19430ea21a1697a6a7a72d503ecd0d28659aec Mon Sep 17 00:00:00 2001 From: Sven Efftinge Date: Wed, 31 Mar 2021 18:04:47 +0000 Subject: [PATCH 08/41] [gitpod] update gitpod config --- .gitpod.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitpod.yml b/.gitpod.yml index 2eb7b13d..ccac2d35 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -10,4 +10,7 @@ ports: vscode: extensions: - - redhat.java \ No newline at end of file + - redhat.java + - vscjava.vscode-java-debug + - vscjava.vscode-java-test + - pivotal.vscode-spring-boot From 2c637955ea14030bc8182f1bbb72dec08d201068 Mon Sep 17 00:00:00 2001 From: Sven Efftinge Date: Sun, 25 Apr 2021 17:46:20 +0200 Subject: [PATCH 09/41] Update readme.md --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 9dca29d4..68d4c40c 100644 --- a/readme.md +++ b/readme.md @@ -1,4 +1,4 @@ -# Spring PetClinic Sample application [![setup automated](https://img.shields.io/badge/Gitpod-ready_to_code-blue?logo=gitpod)](https://gitpod.io/from-referrer/) +# Spring PetClinic Sample application [![setup automated](https://img.shields.io/badge/Gitpod-ready_to_code-orange?logo=gitpod)](https://gitpod.io/from-referrer/) Start coding in a [ready-to-code development environment](https://www.gitpod.io): From e73a1d1b0d6001eefa42b6b60ac0fbd3cef551c6 Mon Sep 17 00:00:00 2001 From: Sven Efftinge Date: Sun, 25 Apr 2021 16:31:00 +0000 Subject: [PATCH 10/41] Make firstname mandatory --- .../java/org/springframework/samples/petclinic/model/Person.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/org/springframework/samples/petclinic/model/Person.java b/src/main/java/org/springframework/samples/petclinic/model/Person.java index e4a3763f..883376fb 100644 --- a/src/main/java/org/springframework/samples/petclinic/model/Person.java +++ b/src/main/java/org/springframework/samples/petclinic/model/Person.java @@ -28,6 +28,7 @@ public class Person extends BaseEntity { @Column(name = "first_name") + @NotEmpty private String firstName; @Column(name = "last_name") From 3c51e92bfebd88c30ca4f0d5141065e1c6092495 Mon Sep 17 00:00:00 2001 From: Kengo TODA Date: Tue, 24 Aug 2021 16:03:05 +0800 Subject: [PATCH 11/41] Update .gitpod.yml 1. use `-B` option to run Maven in non-interactive mode 2. run `dependency:go-offline` goal to download more dependencies and plugins --- .gitpod.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitpod.yml b/.gitpod.yml index ccac2d35..42e63b1e 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -1,6 +1,6 @@ tasks: -- init: ./mvnw package -DskipTests +- init: ./mvnw -B dependency:go-offline package -DskipTests command: java -jar target/*.jar # exposed ports From ab00ab9f990af582e86ac5d8181e14a3998750b0 Mon Sep 17 00:00:00 2001 From: Anton Kosyakov Date: Thu, 3 Feb 2022 14:58:57 +0000 Subject: [PATCH 12/41] jb config --- .run/PetClinicApplication.run.xml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .run/PetClinicApplication.run.xml diff --git a/.run/PetClinicApplication.run.xml b/.run/PetClinicApplication.run.xml new file mode 100644 index 00000000..b518d1f5 --- /dev/null +++ b/.run/PetClinicApplication.run.xml @@ -0,0 +1,17 @@ + + + + + + + + + \ No newline at end of file From bee128dad8419b75e109ae150047df39d3be3581 Mon Sep 17 00:00:00 2001 From: Anton Kosyakov Date: Thu, 10 Feb 2022 08:18:44 +0000 Subject: [PATCH 13/41] check in idea configs --- .gitignore | 6 ---- .idea/.gitignore | 8 +++++ .idea/compiler.xml | 18 +++++++++++ .idea/encodings.xml | 6 ++++ .idea/jarRepositories.xml | 30 +++++++++++++++++++ .idea/misc.xml | 12 ++++++++ .../PetClinicApplication.xml | 1 - .idea/vcs.xml | 6 ++++ 8 files changed, 80 insertions(+), 7 deletions(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/compiler.xml create mode 100644 .idea/encodings.xml create mode 100644 .idea/jarRepositories.xml create mode 100644 .idea/misc.xml rename .run/PetClinicApplication.run.xml => .idea/runConfigurations/PetClinicApplication.xml (88%) create mode 100644 .idea/vcs.xml diff --git a/.gitignore b/.gitignore index 559982f3..8380d887 100644 --- a/.gitignore +++ b/.gitignore @@ -4,13 +4,7 @@ target/* .project .factorypath .attach_pid* -.idea *.iml /target .sts4-cache/ -.vscode/* -!.vscode/settings.json -!.vscode/tasks.json -!.vscode/launch.json -!.vscode/extensions.json _site/ diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 00000000..13566b81 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 00000000..d62a640c --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 00000000..63e90019 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml new file mode 100644 index 00000000..e9b6ab36 --- /dev/null +++ b/.idea/jarRepositories.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 00000000..0f8cea57 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,12 @@ + + + + + + + + \ No newline at end of file diff --git a/.run/PetClinicApplication.run.xml b/.idea/runConfigurations/PetClinicApplication.xml similarity index 88% rename from .run/PetClinicApplication.run.xml rename to .idea/runConfigurations/PetClinicApplication.xml index b518d1f5..80f2ebe4 100644 --- a/.run/PetClinicApplication.run.xml +++ b/.idea/runConfigurations/PetClinicApplication.xml @@ -8,7 +8,6 @@