From 6d50c83938f9e5f6c003852b507f7714a9748b6b Mon Sep 17 00:00:00 2001
From: Ludovic Claude <ludovic.claude54@gmail.com>
Date: Fri, 21 Dec 2018 15:14:16 +0100
Subject: [PATCH] Update Spring boot to 1.5.18, configure Bugsnag for Spring

---
 pom.xml                                                | 10 +++++++---
 .../java/eu/hbp/mip/configuration/BugsnagConfig.java   |  3 +++
 .../mip/configuration/PersistenceConfiguration.java    |  3 +--
 .../hbp/mip/configuration/SecurityConfiguration.java   |  2 +-
 4 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/pom.xml b/pom.xml
index ba10e07ba..4963d1dbd 100644
--- a/pom.xml
+++ b/pom.xml
@@ -14,7 +14,7 @@
     <parent>
         <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-starter-parent</artifactId>
-        <version>1.3.7.RELEASE</version>
+        <version>1.5.18.RELEASE</version>
         <relativePath />
     </parent>
 
@@ -45,7 +45,7 @@
         <hibernate-jpa-2.1-api.version>1.0.0.Final</hibernate-jpa-2.1-api.version>
         <hibernate.version>4.3.11.Final</hibernate.version>
         <spring-data-jpa.version>1.10.11.RELEASE</spring-data-jpa.version>
-        <spring-boot-starter-actuator.version>1.4.7.RELEASE</spring-boot-starter-actuator.version>
+        <spring-boot-starter-actuator.version>1.5.18.RELEASE</spring-boot-starter-actuator.version>
         <aspectjweaver.version>1.8.9</aspectjweaver.version>
         <woken-messages.version>2.8.4</woken-messages.version>
         <javax-inject.version>1</javax-inject.version>
@@ -99,6 +99,10 @@
             <groupId>org.springframework.security.oauth</groupId>
             <artifactId>spring-security-oauth2</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-jpa</artifactId>
+        </dependency>
         <dependency>
             <groupId>org.springframework</groupId>
             <artifactId>spring-orm</artifactId>
@@ -253,7 +257,7 @@
         <dependency>
             <groupId>com.bugsnag</groupId>
             <version>[3.0,4.0)</version>
-            <artifactId>bugsnag</artifactId>
+            <artifactId>bugsnag-spring</artifactId>
         </dependency>
     </dependencies>
 
diff --git a/src/main/java/eu/hbp/mip/configuration/BugsnagConfig.java b/src/main/java/eu/hbp/mip/configuration/BugsnagConfig.java
index c39970604..4bc042fe8 100644
--- a/src/main/java/eu/hbp/mip/configuration/BugsnagConfig.java
+++ b/src/main/java/eu/hbp/mip/configuration/BugsnagConfig.java
@@ -1,10 +1,13 @@
 package eu.hbp.mip.configuration;
 
 import com.bugsnag.Bugsnag;
+import com.bugsnag.BugsnagSpringConfiguration;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Import;
 
 @Configuration
+@Import(BugsnagSpringConfiguration.class)
 public class BugsnagConfig {
     @Bean
     public Bugsnag bugsnag() {
diff --git a/src/main/java/eu/hbp/mip/configuration/PersistenceConfiguration.java b/src/main/java/eu/hbp/mip/configuration/PersistenceConfiguration.java
index 9efcec064..069f65525 100644
--- a/src/main/java/eu/hbp/mip/configuration/PersistenceConfiguration.java
+++ b/src/main/java/eu/hbp/mip/configuration/PersistenceConfiguration.java
@@ -7,7 +7,7 @@ import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder;
 import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.boot.orm.jpa.EntityScan;
+import org.springframework.boot.autoconfigure.domain.EntityScan;
 import org.springframework.context.annotation.*;
 import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
 import org.springframework.jdbc.core.JdbcTemplate;
@@ -16,7 +16,6 @@ import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
 import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter;
 
 import javax.sql.DataSource;
-import java.util.List;
 
 /**
  * Created by mirco on 11.07.16.
diff --git a/src/main/java/eu/hbp/mip/configuration/SecurityConfiguration.java b/src/main/java/eu/hbp/mip/configuration/SecurityConfiguration.java
index d8ec1acfb..51615b207 100644
--- a/src/main/java/eu/hbp/mip/configuration/SecurityConfiguration.java
+++ b/src/main/java/eu/hbp/mip/configuration/SecurityConfiguration.java
@@ -10,7 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.boot.autoconfigure.security.oauth2.resource.ResourceServerProperties;
 import org.springframework.boot.autoconfigure.security.oauth2.resource.UserInfoTokenServices;
-import org.springframework.boot.context.embedded.FilterRegistrationBean;
+import org.springframework.boot.web.servlet.FilterRegistrationBean;
 import org.springframework.boot.context.properties.ConfigurationProperties;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
-- 
GitLab