#553 - Upgrade to Spring Boot 2.3.
This commit is contained in:
committed by
Mark Paluch
parent
5065a04195
commit
c88ad331c0
@@ -46,6 +46,7 @@ install:
|
||||
- /opt/couchbase/bin/couchbase-cli user-manage -c 127.0.0.1:8091 -u Administrator -p password --set --rbac-username=travel-sample --rbac-password=password --roles=admin --auth-domain local
|
||||
|
||||
script:
|
||||
- cp -f settings.xml $HOME/.m2/settings.xml
|
||||
- mvn -version
|
||||
- java -version
|
||||
- mvn clean dependency:list test -U -Dsort -Dmaven.test.redirectTestOutputToFile=true -B -s settings.xml
|
||||
- mvn clean test -U -Dsort -Dmaven.test.redirectTestOutputToFile=true -B -s settings.xml
|
||||
|
||||
@@ -15,21 +15,8 @@
|
||||
*/
|
||||
package example;
|
||||
|
||||
import example.model.Customer;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Profile;
|
||||
import org.springframework.core.env.Environment;
|
||||
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
|
||||
import org.springframework.data.repository.config.BootstrapMode;
|
||||
import org.springframework.orm.jpa.JpaVendorAdapter;
|
||||
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||
|
||||
@SpringBootApplication
|
||||
public class Application {
|
||||
@@ -37,52 +24,4 @@ public class Application {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(Application.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Configures a {@link LocalContainerEntityManagerFactoryBean} to use background initialization for the {@code lazy}
|
||||
* and {@code deferred} profiles.
|
||||
*
|
||||
* @author Oliver Gierke
|
||||
*/
|
||||
@Configuration
|
||||
@Profile({ "lazy", "deferred" })
|
||||
static class LazyJpaConfiguration {
|
||||
|
||||
@Bean
|
||||
public LocalContainerEntityManagerFactoryBean entityManagerFactory(JpaVendorAdapter jpaVendorAdapter,
|
||||
DataSource dataSource, Environment environment) {
|
||||
|
||||
ThreadPoolTaskExecutor threadPoolTaskExecutor = new ThreadPoolTaskExecutor();
|
||||
threadPoolTaskExecutor.setDaemon(true);
|
||||
threadPoolTaskExecutor.afterPropertiesSet();
|
||||
|
||||
LocalContainerEntityManagerFactoryBean emf = new LocalContainerEntityManagerFactoryBean();
|
||||
emf.setBootstrapExecutor(threadPoolTaskExecutor);
|
||||
emf.setDataSource(dataSource);
|
||||
emf.setJpaVendorAdapter(jpaVendorAdapter);
|
||||
emf.setPackagesToScan(Customer.class.getPackage().getName());
|
||||
|
||||
return emf;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Bootstraps Spring Data JPA in lazy mode if the {@code lazy} profile is activated.
|
||||
*
|
||||
* @author Oliver Gierke
|
||||
*/
|
||||
@Profile("lazy")
|
||||
@Configuration
|
||||
@EnableJpaRepositories(bootstrapMode = BootstrapMode.LAZY)
|
||||
static class LazyRepositoryConfiguration {}
|
||||
|
||||
/**
|
||||
* Bootstraps Spring Data JPA in deferred mode if the {@code deferred} profile is activated.
|
||||
*
|
||||
* @author Oliver Gierke
|
||||
*/
|
||||
@Profile("deferred")
|
||||
@Configuration
|
||||
@EnableJpaRepositories(bootstrapMode = BootstrapMode.DEFERRED)
|
||||
static class DeferredRepositoryConfiguration {}
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
spring.data.jpa.repositories.bootstrap-mode=deferred
|
||||
@@ -0,0 +1 @@
|
||||
spring.data.jpa.repositories.bootstrap-mode=lazy
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
<dependency>
|
||||
<groupId>org.mongodb</groupId>
|
||||
<artifactId>mongo-java-driver</artifactId>
|
||||
<artifactId>mongodb-driver-sync</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
2
pom.xml
2
pom.xml
@@ -13,7 +13,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.2.5.RELEASE</version>
|
||||
<version>2.3.0.BUILD-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
||||
@@ -32,11 +32,6 @@
|
||||
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>joda-time</groupId>
|
||||
<artifactId>joda-time</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<dependencyManagement>
|
||||
|
||||
@@ -27,11 +27,6 @@
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-solr</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>joda-time</groupId>
|
||||
<artifactId>joda-time</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
||||
Reference in New Issue
Block a user