Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Spring Cloud starter bootstrap #193

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,21 +69,14 @@
<activation>
<file>
<!-- Just a way to identify a Spring Boot application -->
<exists>src/main/resources/bootstrap.yml</exists>
<exists>src/main/resources/application.yml</exists>
</file>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork>
<!-- Layered jars optimizes Docker images -->
<layers>
<enabled>true</enabled>
</layers>
</configuration>
<executions>
<execution>
<!-- Spring Boot Actuator displays build-related information if a META-INF/build-info.properties file is present -->
Expand Down
4 changes: 0 additions & 4 deletions spring-petclinic-admin-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bootstrap</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
Expand Down
13 changes: 13 additions & 0 deletions spring-petclinic-admin-server/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
spring:
application:
name: admin-server
config:
import: optional:configserver:${CONFIG_SERVER_URL:http://localhost:8888/}


---
spring:
config:
activate:
on-profile: docker
import: configserver:http://config-server:8888
14 changes: 0 additions & 14 deletions spring-petclinic-admin-server/src/main/resources/bootstrap.yml

This file was deleted.

4 changes: 0 additions & 4 deletions spring-petclinic-api-gateway/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-sleuth-zipkin</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bootstrap</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-circuitbreaker-reactor-resilience4j</artifactId>
Expand Down
16 changes: 13 additions & 3 deletions spring-petclinic-api-gateway/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
spring:
application:
name: api-gateway
config:
import: optional:configserver:${CONFIG_SERVER_URL:http://localhost:8888/}
cloud:
loadbalancer:
ribbon:
enabled: false
gateway:
routes:
- id: vets-service
Expand All @@ -23,3 +24,12 @@ spring:
- Path=/api/customer/**
filters:
- StripPrefix=2



---
spring:
config:
activate:
on-profile: docker
import: configserver:http://config-server:8888
14 changes: 0 additions & 14 deletions spring-petclinic-api-gateway/src/main/resources/bootstrap.yml

This file was deleted.

4 changes: 0 additions & 4 deletions spring-petclinic-config-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-server</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bootstrap</artifactId>
</dependency>

<!-- Third-party librairies -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ spring:
server:
git:
uri: https://github.com/spring-petclinic/spring-petclinic-microservices-config
default-label: main
# Use the File System Backend to avoid git pulling. Enable "native" profile in the Config Server.
native:
searchLocations: file:///${GIT_REPO}
Expand Down
4 changes: 0 additions & 4 deletions spring-petclinic-customers-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@
</dependency>

<!-- Spring Cloud -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bootstrap</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
spring:
application:
name: customers-service
config:
import: optional:configserver:${CONFIG_SERVER_URL:http://localhost:8888/}


---
spring:
config:
activate:
on-profile: docker
import: configserver:http://config-server:8888

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
spring.jpa.hibernate.ddl-auto: none

spring:
datasource:
schema: classpath*:db/hsqldb/schema.sql
data: classpath*:db/hsqldb/data.sql
cloud:
config:
enabled: false
sql:
init:
schema-locations: classpath*:db/hsqldb/schema.sql
data-locations: classpath*:db/hsqldb/data.sql
jpa:
hibernate:
ddl-auto: none

eureka:
client:
enabled: false

logging.level.org.springframework: INFO

This file was deleted.

6 changes: 1 addition & 5 deletions spring-petclinic-discovery-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,12 @@
<!-- Spring Cloud -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bootstrap</artifactId>
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
</dependency>

<!-- JAXB is required since Java 9 -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
spring:
application:
name: discovery-server
config:
import: optional:configserver:${CONFIG_SERVER_URL:http://localhost:8888/}

# Avoid some debugging logs at startup
logging:
level:
org:
springframework:
boot: INFO
web: INFO

---
spring:
config:
activate:
on-profile: docker
import: configserver:http://config-server:8888

14 changes: 0 additions & 14 deletions spring-petclinic-discovery-server/src/main/resources/bootstrap.yml

This file was deleted.

4 changes: 0 additions & 4 deletions spring-petclinic-vets-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-sleuth-zipkin</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bootstrap</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
Expand Down

This file was deleted.

16 changes: 16 additions & 0 deletions spring-petclinic-vets-service/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
spring:
application:
name: vets-service
config:
import: optional:configserver:${CONFIG_SERVER_URL:http://localhost:8888/}
cache:
cache-names: vets
profiles:
active: production

---
spring:
config:
activate:
on-profile: docker
import: configserver:http://config-server:8888
14 changes: 0 additions & 14 deletions spring-petclinic-vets-service/src/main/resources/bootstrap.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
spring.jpa.hibernate.ddl-auto: none

spring:
datasource:
schema: classpath*:db/hsqldb/schema.sql
data: classpath*:db/hsqldb/data.sql
cloud:
config:
enabled: false
sql:
init:
schema-locations: classpath*:db/hsqldb/schema.sql
data-locations: classpath*:db/hsqldb/data.sql
jpa:
hibernate:
ddl-auto: none

eureka:
client:
enabled: false

vets:
cache:
Expand Down

This file was deleted.

4 changes: 0 additions & 4 deletions spring-petclinic-visits-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@
</dependency>

<!-- Spring Cloud -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bootstrap</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
Expand Down
Empty file.
13 changes: 13 additions & 0 deletions spring-petclinic-visits-service/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
spring:
application:
name: visits-service
config:
import: optional:configserver:${CONFIG_SERVER_URL:http://localhost:8888/}


---
spring:
config:
activate:
on-profile: docker
import: configserver:http://config-server:8888
14 changes: 0 additions & 14 deletions spring-petclinic-visits-service/src/main/resources/bootstrap.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
spring.jpa.hibernate.ddl-auto: none

spring:
datasource:
schema: classpath*:db/hsqldb/schema.sql
data: classpath*:db/hsqldb/data.sql
cloud:
config:
enabled: false
sql:
init:
schema-locations: classpath*:db/hsqldb/schema.sql
data-locations: classpath*:db/hsqldb/data.sql
jpa:
hibernate:
ddl-auto: none

eureka:
client:
enabled: false

logging.level.org.springframework: INFO

This file was deleted.