Merge pull request #6105 from rozagerardo/geroza/BAEL-9518_Upgrade-parent-spring-5-to-the-latest-version
[BAEL-9518] parent-spring-5 | Upgrade parent-spring-5 to the latest version of Spring 5
This commit is contained in:
commit
a00fa8fdc9
|
@ -4,3 +4,4 @@
|
|||
- [Introduction to EthereumJ](http://www.baeldung.com/ethereumj)
|
||||
- [Creating and Deploying Smart Contracts with Solidity](http://www.baeldung.com/smart-contracts-ethereum-solidity)
|
||||
- [Lightweight Ethereum Clients Using Web3j](http://www.baeldung.com/web3j)
|
||||
|
|
@ -7,10 +7,10 @@
|
|||
<name>ethereum</name>
|
||||
|
||||
<parent>
|
||||
<artifactId>parent-spring-5</artifactId>
|
||||
<artifactId>parent-spring-5-1</artifactId>
|
||||
<groupId>com.baeldung</groupId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<relativePath>../parent-spring-5</relativePath>
|
||||
<relativePath>../parent-spring-5-1</relativePath>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
## Relevant articles:
|
|
@ -0,0 +1,39 @@
|
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.baeldung</groupId>
|
||||
<artifactId>parent-spring-5-1</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
<name>parent-spring-5-1</name>
|
||||
<description>Parent for all spring 5 core modules</description>
|
||||
|
||||
<parent>
|
||||
<groupId>com.baeldung</groupId>
|
||||
<artifactId>parent-modules</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-core</artifactId>
|
||||
<version>${spring.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter-engine</artifactId>
|
||||
<version>${junit.jupiter.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<properties>
|
||||
<spring.version>5.0.6.RELEASE</spring.version>
|
||||
<junit.jupiter.version>5.0.2</junit.jupiter.version>
|
||||
<jackson-databind.version>2.9.6</jackson-databind.version>
|
||||
<jackson.version>2.9.6</jackson.version>
|
||||
<spring-security.version>5.0.6.RELEASE</spring-security.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
|
@ -29,11 +29,11 @@
|
|||
</dependencies>
|
||||
|
||||
<properties>
|
||||
<spring.version>5.0.6.RELEASE</spring.version>
|
||||
<spring.version>5.1.2.RELEASE</spring.version>
|
||||
<junit.jupiter.version>5.0.2</junit.jupiter.version>
|
||||
<jackson-databind.version>2.9.6</jackson-databind.version>
|
||||
<jackson.version>2.9.6</jackson.version>
|
||||
<spring-security.version>5.0.6.RELEASE</spring-security.version>
|
||||
<spring-security.version>5.1.2.RELEASE</spring-security.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
|
@ -9,9 +9,9 @@
|
|||
|
||||
<parent>
|
||||
<groupId>com.baeldung</groupId>
|
||||
<artifactId>parent-spring-5</artifactId>
|
||||
<artifactId>parent-spring-5-1</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<relativePath>../../parent-spring-5</relativePath>
|
||||
<relativePath>../../parent-spring-5-1</relativePath>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
|
||||
<parent>
|
||||
<groupId>com.baeldung</groupId>
|
||||
<artifactId>parent-spring-5</artifactId>
|
||||
<artifactId>parent-spring-5-1</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<relativePath>../../parent-spring-5</relativePath>
|
||||
<relativePath>../../parent-spring-5-1</relativePath>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
@ -96,10 +96,10 @@
|
|||
</build>
|
||||
|
||||
<properties>
|
||||
<spring.version>5.1.0.RELEASE</spring.version>
|
||||
<org.springframework.data.version>2.1.2.RELEASE</org.springframework.data.version>
|
||||
<querydsl.version>4.1.4</querydsl.version>
|
||||
<mysema.maven.version>1.1.3</mysema.maven.version>
|
||||
<spring.version>5.1.0.RELEASE</spring.version>
|
||||
<mongodb-reactivestreams.version>1.9.2</mongodb-reactivestreams.version>
|
||||
<projectreactor.version>3.2.0.RELEASE</projectreactor.version>
|
||||
|
||||
|
|
6
pom.xml
6
pom.xml
|
@ -330,6 +330,7 @@
|
|||
<module>parent-boot-2</module>
|
||||
<module>parent-spring-4</module>
|
||||
<module>parent-spring-5</module>
|
||||
<module>parent-spring-5-1</module>
|
||||
<module>parent-java</module>
|
||||
<module>parent-kotlin</module>
|
||||
|
||||
|
@ -602,6 +603,7 @@
|
|||
<module>parent-boot-2</module>
|
||||
<module>parent-spring-4</module>
|
||||
<module>parent-spring-5</module>
|
||||
<module>parent-spring-5-1</module>
|
||||
<module>parent-java</module>
|
||||
<module>parent-kotlin</module>
|
||||
|
||||
|
@ -995,6 +997,7 @@
|
|||
<module>parent-boot-2</module>
|
||||
<module>parent-spring-4</module>
|
||||
<module>parent-spring-5</module>
|
||||
<module>parent-spring-5-1</module>
|
||||
<module>parent-java</module>
|
||||
<module>parent-kotlin</module>
|
||||
|
||||
|
@ -1046,6 +1049,7 @@
|
|||
<module>parent-boot-2</module>
|
||||
<module>parent-spring-4</module>
|
||||
<module>parent-spring-5</module>
|
||||
<module>parent-spring-5-1</module>
|
||||
<module>parent-java</module>
|
||||
<module>parent-kotlin</module>
|
||||
|
||||
|
@ -1313,6 +1317,7 @@
|
|||
<module>parent-boot-2</module>
|
||||
<module>parent-spring-4</module>
|
||||
<module>parent-spring-5</module>
|
||||
<module>parent-spring-5-1</module>
|
||||
<module>parent-java</module>
|
||||
<module>parent-kotlin</module>
|
||||
|
||||
|
@ -1545,6 +1550,7 @@
|
|||
<module>parent-boot-2</module>
|
||||
<module>parent-spring-4</module>
|
||||
<module>parent-spring-5</module>
|
||||
<module>parent-spring-5-1</module>
|
||||
<module>parent-java</module>
|
||||
<module>parent-kotlin</module>
|
||||
|
||||
|
|
|
@ -10,9 +10,9 @@
|
|||
|
||||
<parent>
|
||||
<groupId>com.baeldung</groupId>
|
||||
<artifactId>parent-spring-5</artifactId>
|
||||
<artifactId>parent-spring-5-1</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<relativePath>../parent-spring-5</relativePath>
|
||||
<relativePath>../parent-spring-5-1</relativePath>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
|
|
@ -11,9 +11,9 @@
|
|||
|
||||
<parent>
|
||||
<groupId>com.baeldung</groupId>
|
||||
<artifactId>parent-spring-5</artifactId>
|
||||
<artifactId>parent-spring-5-1</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<relativePath>../parent-spring-5</relativePath>
|
||||
<relativePath>../parent-spring-5-1</relativePath>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
|
|
@ -8,10 +8,10 @@
|
|||
<packaging>war</packaging>
|
||||
|
||||
<parent>
|
||||
<artifactId>parent-spring-5</artifactId>
|
||||
<artifactId>parent-spring-5-1</artifactId>
|
||||
<groupId>com.baeldung</groupId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<relativePath>../parent-spring-5</relativePath>
|
||||
<relativePath>../parent-spring-5-1</relativePath>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
|
|
@ -154,25 +154,6 @@
|
|||
<outputDirectory>${deploy-path}</outputDirectory>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>${maven-surefire-plugin.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>default-test</id>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.junit.platform</groupId>
|
||||
<artifactId>junit-platform-surefire-provider</artifactId>
|
||||
<version>${junit.platform.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
<finalName>spring-mvc-simple</finalName>
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package com.baeldung.spring;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.ViewResolver;
|
||||
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
|
||||
|
|
|
@ -4,7 +4,7 @@ import org.apache.http.HttpHost;
|
|||
import org.springframework.beans.factory.FactoryBean;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.http.client.ClientHttpRequestFactory;
|
||||
import org.springframework.http.client.support.BasicAuthorizationInterceptor;
|
||||
import org.springframework.http.client.support.BasicAuthenticationInterceptor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
|
@ -38,7 +38,7 @@ public class RestTemplateFactory implements FactoryBean<RestTemplate>, Initializ
|
|||
HttpHost host = new HttpHost("localhost", 8082, "http");
|
||||
final ClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactoryBasicAuth(host);
|
||||
restTemplate = new RestTemplate(requestFactory);
|
||||
restTemplate.getInterceptors().add(new BasicAuthorizationInterceptor("user1", "user1Pass"));
|
||||
restTemplate.getInterceptors().add(new BasicAuthenticationInterceptor("user1", "user1Pass"));
|
||||
}
|
||||
|
||||
}
|
|
@ -8,7 +8,6 @@ import org.springframework.http.converter.HttpMessageConverter;
|
|||
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
|
||||
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
||||
|
||||
@Configuration
|
||||
@EnableWebMvc
|
||||
|
|
|
@ -6,7 +6,7 @@ import org.springframework.test.context.ContextConfiguration;
|
|||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration({ "/WebSecurityConfig.xml" })
|
||||
@ContextConfiguration({ "/webSecurityConfig.xml" })
|
||||
public class SpringContextIntegrationTest {
|
||||
|
||||
@Test
|
||||
|
|
|
@ -29,7 +29,7 @@ public class FooLiveTest {
|
|||
// }
|
||||
// return RestAssured.given().cookie("JSESSIONID", cookie);
|
||||
return RestAssured.given()
|
||||
.auth()
|
||||
.auth().preemptive()
|
||||
.basic("user", "userPass");
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
|
|||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
import org.springframework.web.servlet.i18n.CookieLocaleResolver;
|
||||
import org.springframework.web.servlet.i18n.LocaleChangeInterceptor;
|
||||
import org.springframework.web.servlet.resource.GzipResourceResolver;
|
||||
import org.springframework.web.servlet.resource.EncodedResourceResolver;
|
||||
import org.springframework.web.servlet.resource.PathResourceResolver;
|
||||
import org.springframework.web.servlet.resource.ResourceUrlEncodingFilter;
|
||||
import org.springframework.web.servlet.view.InternalResourceViewResolver;
|
||||
|
@ -57,10 +57,10 @@ public class MvcConfig implements WebMvcConfigurer {
|
|||
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
||||
// For examples using Spring 4.1.0
|
||||
if ((env.getProperty("resource.handler.conf")).equals("4.1.0")) {
|
||||
registry.addResourceHandler("/js/**").addResourceLocations("/js/").setCachePeriod(3600).resourceChain(true).addResolver(new GzipResourceResolver()).addResolver(new PathResourceResolver());
|
||||
registry.addResourceHandler("/js/**").addResourceLocations("/js/").setCachePeriod(3600).resourceChain(true).addResolver(new EncodedResourceResolver()).addResolver(new PathResourceResolver());
|
||||
registry.addResourceHandler("/resources/**").addResourceLocations("/resources/", "classpath:/other-resources/").setCachePeriod(3600).resourceChain(true).addResolver(new PathResourceResolver());
|
||||
registry.addResourceHandler("/files/**").addResourceLocations("file:/Users/Elena/").setCachePeriod(3600).resourceChain(true).addResolver(new PathResourceResolver());
|
||||
registry.addResourceHandler("/other-files/**").addResourceLocations("file:/Users/Elena/").setCachePeriod(3600).resourceChain(true).addResolver(new GzipResourceResolver());
|
||||
registry.addResourceHandler("/other-files/**").addResourceLocations("file:/Users/Elena/").setCachePeriod(3600).resourceChain(true).addResolver(new EncodedResourceResolver());
|
||||
}
|
||||
// For examples using Spring 4.0.7
|
||||
else if ((env.getProperty("resource.handler.conf")).equals("4.0.7")) {
|
||||
|
|
Loading…
Reference in New Issue