diff --git a/pom.xml b/pom.xml index 9802b893525..a964fe25b84 100644 --- a/pom.xml +++ b/pom.xml @@ -1,277 +1,290 @@ - 4.0.0 - org.springframework.samples - spring-petclinic - 2.2.0.BUILD-SNAPSHOT + xmlns="http://maven.apache.org/POM/4.0.0" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/maven-v4_0_0.xsd"> + 4.0.0 + org.springframework.samples + spring-petclinic + 2.2.0.BUILD-SNAPSHOT - - org.springframework.boot - spring-boot-starter-parent - 2.2.0.RELEASE - - petclinic + + org.springframework.boot + spring-boot-starter-parent + 2.5.0 + + petclinic + war - + - - 1.8 - UTF-8 - UTF-8 + + 1.8 + UTF-8 + UTF-8 - - 3.3.6 - 1.11.4 - 2.2.4 - 1.8.0 + + 3.3.6 + 1.11.4 + 2.2.4 + 1.8.0 - 0.8.2 + 0.8.2 - + - - - - org.springframework.boot - spring-boot-starter-actuator - - - org.springframework.boot - spring-boot-starter-cache - - - org.springframework.boot - spring-boot-starter-data-jpa - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-thymeleaf - - - org.springframework.boot - spring-boot-starter-test - test - - - org.junit.vintage - junit-vintage-engine - - - + + + + org.springframework.boot + spring-boot-starter-actuator + + + org.springframework.boot + spring-boot-starter-cache + + + org.springframework.boot + spring-boot-starter-data-jpa + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-thymeleaf + + + org.springframework.boot + spring-boot-starter-test + test + + + org.junit.vintage + junit-vintage-engine + + + - - - org.hsqldb - hsqldb - runtime - - - mysql - mysql-connector-java - runtime - + + + org.hsqldb + hsqldb + runtime + + + mysql + mysql-connector-java + runtime + - - - javax.cache - cache-api - - - org.ehcache - ehcache - + + + javax.cache + cache-api + + + org.ehcache + ehcache + + + javax.xml.bind + jaxb-api + 2.3.0 + + + javax.validation + validation-api + 2.0.1.Final + - - - org.webjars - webjars-locator-core - - - org.webjars - jquery - ${webjars-jquery.version} - - - org.webjars - jquery-ui - ${webjars-jquery-ui.version} - - - org.webjars - bootstrap - ${webjars-bootstrap.version} - - + + + org.webjars + webjars-locator-core + + + org.webjars + jquery + ${webjars-jquery.version} + + + org.webjars + jquery-ui + ${webjars-jquery-ui.version} + + + org.webjars + bootstrap + ${webjars-bootstrap.version} + + - - - org.junit.jupiter - junit-jupiter-engine - test - - - org.mockito - mockito-junit-jupiter - test - + + + org.junit.jupiter + junit-jupiter-engine + test + + + org.mockito + mockito-junit-jupiter + test + - - org.springframework.boot - spring-boot-devtools - true - - + + org.springframework.boot + spring-boot-devtools + true + + - - - - org.springframework.boot - spring-boot-maven-plugin - - - - - build-info - - - - ${project.build.sourceEncoding} - ${project.reporting.outputEncoding} - ${maven.compiler.source} - ${maven.compiler.target} - - - - - - - org.jacoco - jacoco-maven-plugin - ${jacoco.version} - - - - prepare-agent - - - - report - prepare-package - - report - - - - + + ${project.name} + + + org.springframework.boot + spring-boot-maven-plugin + + + + + build-info + + + + ${project.build.sourceEncoding} + ${project.reporting.outputEncoding} + ${maven.compiler.source} + ${maven.compiler.target} + + + + + + + org.jacoco + jacoco-maven-plugin + ${jacoco.version} + + + + prepare-agent + + + + report + prepare-package + + report + + + + - - - pl.project13.maven - git-commit-id-plugin - - - - revision - - - - - true - yyyy-MM-dd'T'HH:mm:ssZ - true - ${project.build.outputDirectory}/git.properties - - false - - + + + pl.project13.maven + git-commit-id-plugin + + + + revision + + + + + true + yyyy-MM-dd'T'HH:mm:ssZ + true + ${project.build.outputDirectory}/git.properties + + false + + - - ro.isdc.wro4j - wro4j-maven-plugin - ${wro4j.version} - - - generate-resources - - run - - - - - ro.isdc.wro.maven.plugin.manager.factory.ConfigurableWroManagerFactory - ${project.build.directory}/classes/static/resources/css - ${basedir}/src/main/wro/wro.xml - ${basedir}/src/main/wro/wro.properties - ${basedir}/src/main/less - - - - org.webjars - bootstrap - ${webjars-bootstrap.version} - - - org.mockito - mockito-core - ${mockito.version} - - - - - + + ro.isdc.wro4j + wro4j-maven-plugin + ${wro4j.version} + + + generate-resources + + run + + + + + ro.isdc.wro.maven.plugin.manager.factory.ConfigurableWroManagerFactory + + ${project.build.directory}/classes/static/resources/css + ${basedir}/src/main/wro/wro.xml + ${basedir}/src/main/wro/wro.properties + ${basedir}/src/main/less + + + + org.webjars + bootstrap + ${webjars-bootstrap.version} + + + org.mockito + mockito-core + ${mockito.version} + + + + + - - - - Apache License, Version 2.0 - https://www.apache.org/licenses/LICENSE-2.0 - - + + + + Apache License, Version 2.0 + https://www.apache.org/licenses/LICENSE-2.0 + + - - - spring-snapshots - Spring Snapshots - https://repo.spring.io/snapshot - - true - - - - spring-milestones - Spring Milestones - https://repo.spring.io/milestone - - false - - - + + + spring-snapshots + Spring Snapshots + https://repo.spring.io/snapshot + + true + + + + spring-milestones + Spring Milestones + https://repo.spring.io/milestone + + false + + + - - - spring-snapshots - Spring Snapshots - https://repo.spring.io/snapshot - - true - - - - spring-milestones - Spring Milestones - https://repo.spring.io/milestone - - false - - - + + + spring-snapshots + Spring Snapshots + https://repo.spring.io/snapshot + + true + + + + spring-milestones + Spring Milestones + https://repo.spring.io/milestone + + false + + + diff --git a/src/main/java/org/springframework/samples/petclinic/PetClinicApplication.java b/src/main/java/org/springframework/samples/petclinic/PetClinicApplication.java index cf0c5e3010f..90436025949 100644 --- a/src/main/java/org/springframework/samples/petclinic/PetClinicApplication.java +++ b/src/main/java/org/springframework/samples/petclinic/PetClinicApplication.java @@ -18,6 +18,8 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.builder.SpringApplicationBuilder; +import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; /** * PetClinic Spring Boot Application. @@ -26,7 +28,12 @@ * */ @SpringBootApplication -public class PetClinicApplication { +public class PetClinicApplication extends SpringBootServletInitializer { + + @Override + protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { + return application.sources(PetClinicApplication.class); + } public static void main(String[] args) { SpringApplication.run(PetClinicApplication.class, args); diff --git a/src/main/resources/application-mysql.properties b/src/main/resources/application-mysql.properties index 823b32b697f..e1eb97add91 100644 --- a/src/main/resources/application-mysql.properties +++ b/src/main/resources/application-mysql.properties @@ -1,7 +1,7 @@ # database init, supports mysql too database=mysql -spring.datasource.url=jdbc:mysql://localhost/petclinic -spring.datasource.username=root -spring.datasource.password=petclinic +spring.datasource.url=jdbc:mysql://${DB_HOSTNAME:localhost}/${DB_SCHEMA_NAME:petclinic} +spring.datasource.username=${DB_USER:clinic} +spring.datasource.password=${DB_PASSWORD:petclinic} # Uncomment this the first time the app runs # spring.datasource.initialization-mode=always diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index b93ff4de30b..1bbf2419622 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -3,6 +3,8 @@ database=hsqldb spring.datasource.schema=classpath*:db/${database}/schema.sql spring.datasource.data=classpath*:db/${database}/data.sql +spring.profiles.active=mysql + # Web spring.thymeleaf.mode=HTML