Skip to content

Spring Boot upgrade 2.7.6 and passwordless #50

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

Open
wants to merge 23 commits into
base: 2.7.6
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
8e446ae
Complete Apache 2.0 license
arey Feb 6, 2021
b12d05b
Upgrade to Spring Cloud 2020.0.1 (aka Ilford) and Spring Boot 2.4.2 (…
arey Feb 28, 2021
1f8191d
Added chaos monkey setup (#177)
marcingrzejszczak Apr 20, 2021
101ffbd
Do not fail packaging if repo info is absent #91
arey May 6, 2021
73da0b0
Bump Spring Cloud version to 2020.0.2 and Spring Boot version to 2.4.…
jonatan-ivanov May 8, 2021
8818cc9
Bump up version to 2.4.5 (#179)
jonatan-ivanov May 9, 2021
7259a82
Upgrade to Spring Cloud 2020.0.2 and Spring Boot 2.5.1 (#181)
arey Jul 10, 2021
8af5e01
Migrate from Travis CI to GitHub actions (#187)
arey Oct 22, 2021
501a1eb
Delete .travis.yml
arey Oct 31, 2021
c47e99a
Upgrade to Spring Cloud 2021.0.0 and Spring Boot 2.6.1 (#191)
arey Dec 11, 2021
0ab2e95
Remove Spring Cloud starter bootstrap (#193)
arey Dec 15, 2021
05007a6
Return to owner details (#195)
arey Dec 18, 2021
8685f93
Refactoring & clean up (#201)
ramazansakin Feb 27, 2022
f8d05ba
Spring Cloud 2021.0.1 (#202)
arey Mar 25, 2022
a05f4fb
Bump to Spring Cloud 2021.0.2 and Spring Boot 2.6.7 (#204)
arey May 15, 2022
42f24ec
Merge branch 'master' of https://github.com/felipmiguel/spring-petcli…
felipmiguel Nov 25, 2022
c43023a
update spring 2.6.7 -> 2.6.11
felipmiguel Nov 29, 2022
86e5bfb
database initialization update 2.7.6
felipmiguel Nov 30, 2022
336dd7c
remove bootstrap.yml
felipmiguel Nov 30, 2022
2509c33
springboot 2.6.11 cloud 2021.0.5
felipmiguel Nov 30, 2022
2b50635
fix docker-compose to run locally
felipmiguel Nov 30, 2022
9656f63
upgrade 2.7.6 + passwordless
felipmiguel Jan 10, 2023
4a7c9af
updated readme
felipmiguel Jan 10, 2023
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
402 changes: 208 additions & 194 deletions README.md

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ services:
entrypoint: ["./dockerize","-wait=tcp://discovery-server:8761","-timeout=60s","--","java", "org.springframework.boot.loader.JarLauncher"]
ports:
- 8081:8081
environment:
- SERVER_PORT=8081

visits-service:
image: springcommunity/spring-petclinic-visits-service
Expand All @@ -39,6 +41,8 @@ services:
entrypoint: ["./dockerize","-wait=tcp://discovery-server:8761","-timeout=60s","--","java", "org.springframework.boot.loader.JarLauncher"]
ports:
- 8082:8082
environment:
- SERVER_PORT=8082

vets-service:
image: springcommunity/spring-petclinic-vets-service
Expand All @@ -50,6 +54,9 @@ services:
entrypoint: ["./dockerize","-wait=tcp://discovery-server:8761","-timeout=60s","--","java", "org.springframework.boot.loader.JarLauncher"]
ports:
- 8083:8083
environment:
- SERVER_PORT=8083


api-gateway:
image: springcommunity/spring-petclinic-api-gateway
Expand All @@ -62,6 +69,7 @@ services:
ports:
- 8080:8080


tracing-server:
image: openzipkin/zipkin
container_name: tracing-server
Expand Down
27 changes: 14 additions & 13 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.1</version>
<version>2.7.6</version>
</parent>

<groupId>org.springframework.samples</groupId>
<artifactId>spring-petclinic-microservices</artifactId>
<version>2.5.1</version>
<version>2.7.6</version>
<name>${project.artifactId}</name>
<packaging>pom</packaging>

Expand All @@ -29,15 +29,16 @@
<java.version>1.8</java.version>
<assertj.version>3.17.1</assertj.version>

<spring-boot.version>2.5.1</spring-boot.version>
<spring-cloud.version>2020.0.3</spring-cloud.version>
<chaos-monkey-spring-boot.version>2.3.10</chaos-monkey-spring-boot.version>

<spring-cloud.version>2021.0.5</spring-cloud.version>
<chaos-monkey-spring-boot.version>2.6.1</chaos-monkey-spring-boot.version>

<docker.image.prefix>springcommunity</docker.image.prefix>
<docker.image.exposed.port>9090</docker.image.exposed.port>
<docker.image.dockerfile.dir>${basedir}</docker.image.dockerfile.dir>
<docker.image.dockerize.version>v0.6.1</docker.image.dockerize.version>
<docker.plugin.version>1.2.0</docker.plugin.version>
<version.spring.cloud.azure>4.5.0</version.spring.cloud.azure>
</properties>

<dependencyManagement>
Expand All @@ -60,6 +61,13 @@
<version>${assertj.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.azure.spring</groupId>
<artifactId>spring-cloud-azure-dependencies</artifactId>
<version>${version.spring.cloud.azure}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

Expand All @@ -69,21 +77,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: 2 additions & 2 deletions spring-petclinic-admin-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
<parent>
<groupId>org.springframework.samples</groupId>
<artifactId>spring-petclinic-microservices</artifactId>
<version>2.5.1</version>
<version>2.7.6</version>
</parent>

<properties>
<spring-boot-admin.version>2.4.1</spring-boot-admin.version>
<spring-boot-admin.version>2.5.4</spring-boot-admin.version>
<docker.image.exposed.port>9090</docker.image.exposed.port>
<docker.image.dockerfile.dir>${basedir}/../docker</docker.image.dockerfile.dir>
</properties>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
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.

2 changes: 1 addition & 1 deletion spring-petclinic-api-gateway/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>org.springframework.samples</groupId>
<artifactId>spring-petclinic-microservices</artifactId>
<version>2.5.1</version>
<version>2.7.6</version>
</parent>

<properties>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -18,7 +18,6 @@
import lombok.RequiredArgsConstructor;
import org.springframework.samples.petclinic.api.dto.OwnerDetails;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.reactive.function.client.WebClient;
import reactor.core.publisher.Mono;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
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.

Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@
<script src="/scripts/vet-list/vet-list.js"></script>
<script src="/scripts/vet-list/vet-list.controller.js"></script>
<script src="/scripts/vet-list/vet-list.component.js"></script>

<script src="/scripts/infrastructure/infrastructure.js"></script>
<script src="/scripts/infrastructure/httpErrorHandlingInterceptor.js"></script>
</head>

<body class="container">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
'use strict';
/* App Module */
var petClinicApp = angular.module('petClinicApp', [
'ui.router', 'layoutNav', 'layoutFooter', 'layoutWelcome',
'ui.router', 'infrastructure', 'layoutNav', 'layoutFooter', 'layoutWelcome',
'ownerList', 'ownerDetails', 'ownerForm', 'petForm', 'visits', 'vetList']);

petClinicApp.config(['$stateProvider', '$urlRouterProvider', '$locationProvider', '$httpProvider', function(
$stateProvider, $urlRouterProvider, $locationProvider, $httpProvider) {

// safari turns to be lazy sending the Cache-Control header
$httpProvider.defaults.headers.common["Cache-Control"] = 'no-cache';
$httpProvider.interceptors.push('HttpErrorHandlingInterceptor');

$locationProvider.hashPrefix('!');

Expand All @@ -32,4 +33,4 @@ petClinicApp.config(['$stateProvider', '$urlRouterProvider', '$locationProvider'
angular.module(mod).component(mod, {
templateUrl: "scripts/fragments/" + c + ".html"
});
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
'use strict';

/**
* Global HTTP errors handler.
*/
angular.module('infrastructure')
.factory('HttpErrorHandlingInterceptor', function () {
return {
responseError: function (response) {
var error = response.data;
alert(error.error + "\r\n" + error.errors.map(function (e) {
return e.field + ": " + e.defaultMessage;
}).join("\r\n"));
return response;
}
}
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
'use strict';

angular.module('infrastructure', []);
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,15 @@ angular.module('ownerForm')

self.submitOwnerForm = function () {
var id = self.owner.id;
var req;

if (id) {
req = $http.put("api/customer/owners/" + id, self.owner);
$http.put('api/customer/owners/' + id, self.owner).then(function () {
$state.go('ownerDetails', {ownerId: ownerId});
});
} else {
req = $http.post("api/customer/owners", self.owner);
$http.post('api/customer/owners', self.owner).then(function () {
$state.go('owners');
});
}

req.then(function () {
$state.go('owners');
}, function (response) {
var error = response.data;
alert(error.error + "\r\n" + error.errors.map(function (e) {
return e.field + ": " + e.defaultMessage;
}).join("\r\n"));
});
};
}]);
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ <h2>Owner</h2>

<div class="form-group">
<label>Telephone</label>
<input class="form-control" ng-model="$ctrl.owner.telephone" name="telephone" required/>
<input class="form-control" ng-model="$ctrl.owner.telephone" pattern="[0-9]{12}" placeholder="905554443322"
name="telephone" maxlength="12" required/>
<span ng-show="ownerForm.telephone.$error.required" class="help-block">Telephone is required.</span>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,7 @@ angular.module('petForm')
}

req.then(function () {
$state.go("owners", {ownerId: ownerId});
}, function (response) {
var error = response.data;
error.errors = error.errors || [];
alert(error.error + "\r\n" + error.errors.map(function (e) {
return e.field + ": " + e.defaultMessage;
}).join("\r\n"));
$state.go('ownerDetails', {ownerId: ownerId});
});
};
}]);
Loading