Skip to content

Commit c7ba38f

Browse files
committed
migrated the following modules using parent-spring-5 to spring 5.1:
spring-mvc-simple spring-security-mvc-custom spring-security-mvc-login spring-security-rest spring-security-rest-basic-auth spring-static-resources spring-thymeleaf
1 parent 3bad1ab commit c7ba38f

File tree

16 files changed

+64
-40
lines changed

16 files changed

+64
-40
lines changed

ethereum/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
<name>ethereum</name>
88

99
<parent>
10-
<artifactId>parent-spring-5</artifactId>
10+
<artifactId>parent-spring-5-1</artifactId>
1111
<groupId>com.baeldung</groupId>
1212
<version>0.0.1-SNAPSHOT</version>
13-
<relativePath>../parent-spring-5</relativePath>
13+
<relativePath>../parent-spring-5-1</relativePath>
1414
</parent>
1515

1616
<dependencies>

parent-spring-5-1/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
## Relevant articles:

parent-spring-5-1/pom.xml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<groupId>com.baeldung</groupId>
5+
<artifactId>parent-spring-5-1</artifactId>
6+
<version>0.0.1-SNAPSHOT</version>
7+
<packaging>pom</packaging>
8+
<name>parent-spring-5-1</name>
9+
<description>Parent for all spring 5 core modules</description>
10+
11+
<parent>
12+
<groupId>com.baeldung</groupId>
13+
<artifactId>parent-modules</artifactId>
14+
<version>1.0.0-SNAPSHOT</version>
15+
</parent>
16+
17+
<dependencies>
18+
<dependency>
19+
<groupId>org.springframework</groupId>
20+
<artifactId>spring-core</artifactId>
21+
<version>${spring.version}</version>
22+
</dependency>
23+
<dependency>
24+
<groupId>org.junit.jupiter</groupId>
25+
<artifactId>junit-jupiter-engine</artifactId>
26+
<version>${junit.jupiter.version}</version>
27+
<scope>test</scope>
28+
</dependency>
29+
</dependencies>
30+
31+
<properties>
32+
<spring.version>5.0.6.RELEASE</spring.version>
33+
<junit.jupiter.version>5.0.2</junit.jupiter.version>
34+
<jackson-databind.version>2.9.6</jackson-databind.version>
35+
<jackson.version>2.9.6</jackson.version>
36+
<spring-security.version>5.0.6.RELEASE</spring-security.version>
37+
</properties>
38+
39+
</project>

parent-spring-5/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@
2929
</dependencies>
3030

3131
<properties>
32-
<spring.version>5.0.6.RELEASE</spring.version>
32+
<spring.version>5.1.2.RELEASE</spring.version>
3333
<junit.jupiter.version>5.0.2</junit.jupiter.version>
3434
<jackson-databind.version>2.9.6</jackson-databind.version>
3535
<jackson.version>2.9.6</jackson.version>
36-
<spring-security.version>5.0.6.RELEASE</spring-security.version>
36+
<spring-security.version>5.1.2.RELEASE</spring-security.version>
3737
</properties>
3838

3939
</project>

persistence-modules/spring-data-elasticsearch/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99

1010
<parent>
1111
<groupId>com.baeldung</groupId>
12-
<artifactId>parent-spring-5</artifactId>
12+
<artifactId>parent-spring-5-1</artifactId>
1313
<version>0.0.1-SNAPSHOT</version>
14-
<relativePath>../../parent-spring-5</relativePath>
14+
<relativePath>../../parent-spring-5-1</relativePath>
1515
</parent>
1616

1717
<dependencies>

persistence-modules/spring-data-mongodb/pom.xml

+2-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77
<parent>
88
<groupId>com.baeldung</groupId>
9-
<artifactId>parent-spring-5</artifactId>
9+
<artifactId>parent-spring-5-1</artifactId>
1010
<version>0.0.1-SNAPSHOT</version>
11-
<relativePath>../../parent-spring-5</relativePath>
11+
<relativePath>../../parent-spring-5-1</relativePath>
1212
</parent>
1313

1414
<dependencies>
@@ -99,7 +99,6 @@
9999
<org.springframework.data.version>2.1.2.RELEASE</org.springframework.data.version>
100100
<querydsl.version>4.1.4</querydsl.version>
101101
<mysema.maven.version>1.1.3</mysema.maven.version>
102-
<spring.version>5.1.0.RELEASE</spring.version>
103102
<mongodb-reactivestreams.version>1.9.2</mongodb-reactivestreams.version>
104103
<projectreactor.version>3.2.0.RELEASE</projectreactor.version>
105104

pom.xml

+6
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@
329329
<module>parent-boot-2</module>
330330
<module>parent-spring-4</module>
331331
<module>parent-spring-5</module>
332+
<module>parent-spring-5-1</module>
332333
<module>parent-java</module>
333334
<module>parent-kotlin</module>
334335

@@ -600,6 +601,7 @@
600601
<module>parent-boot-2</module>
601602
<module>parent-spring-4</module>
602603
<module>parent-spring-5</module>
604+
<module>parent-spring-5-1</module>
603605
<module>parent-java</module>
604606
<module>parent-kotlin</module>
605607

@@ -993,6 +995,7 @@
993995
<module>parent-boot-2</module>
994996
<module>parent-spring-4</module>
995997
<module>parent-spring-5</module>
998+
<module>parent-spring-5-1</module>
996999
<module>parent-java</module>
9971000
<module>parent-kotlin</module>
9981001

@@ -1045,6 +1048,7 @@
10451048
<module>parent-boot-2</module>
10461049
<module>parent-spring-4</module>
10471050
<module>parent-spring-5</module>
1051+
<module>parent-spring-5-1</module>
10481052
<module>parent-java</module>
10491053
<module>parent-kotlin</module>
10501054

@@ -1312,6 +1316,7 @@
13121316
<module>parent-boot-2</module>
13131317
<module>parent-spring-4</module>
13141318
<module>parent-spring-5</module>
1319+
<module>parent-spring-5-1</module>
13151320
<module>parent-java</module>
13161321
<module>parent-kotlin</module>
13171322

@@ -1544,6 +1549,7 @@
15441549
<module>parent-boot-2</module>
15451550
<module>parent-spring-4</module>
15461551
<module>parent-spring-5</module>
1552+
<module>parent-spring-5-1</module>
15471553
<module>parent-java</module>
15481554
<module>parent-kotlin</module>
15491555

spring-dispatcher-servlet/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010

1111
<parent>
1212
<groupId>com.baeldung</groupId>
13-
<artifactId>parent-spring-5</artifactId>
13+
<artifactId>parent-spring-5-1</artifactId>
1414
<version>0.0.1-SNAPSHOT</version>
15-
<relativePath>../parent-spring-5</relativePath>
15+
<relativePath>../parent-spring-5-1</relativePath>
1616
</parent>
1717

1818
<dependencies>

spring-mvc-forms-jsp/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111

1212
<parent>
1313
<groupId>com.baeldung</groupId>
14-
<artifactId>parent-spring-5</artifactId>
14+
<artifactId>parent-spring-5-1</artifactId>
1515
<version>0.0.1-SNAPSHOT</version>
16-
<relativePath>../parent-spring-5</relativePath>
16+
<relativePath>../parent-spring-5-1</relativePath>
1717
</parent>
1818

1919
<dependencies>

spring-mvc-java/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
<packaging>war</packaging>
99

1010
<parent>
11-
<artifactId>parent-spring-5</artifactId>
11+
<artifactId>parent-spring-5-1</artifactId>
1212
<groupId>com.baeldung</groupId>
1313
<version>0.0.1-SNAPSHOT</version>
14-
<relativePath>../parent-spring-5</relativePath>
14+
<relativePath>../parent-spring-5-1</relativePath>
1515
</parent>
1616

1717
<dependencies>

spring-mvc-simple/pom.xml

-19
Original file line numberDiff line numberDiff line change
@@ -154,25 +154,6 @@
154154
<outputDirectory>${deploy-path}</outputDirectory>
155155
</configuration>
156156
</plugin>
157-
<plugin>
158-
<artifactId>maven-surefire-plugin</artifactId>
159-
<version>${maven-surefire-plugin.version}</version>
160-
<executions>
161-
<execution>
162-
<id>default-test</id>
163-
<configuration>
164-
<skip>true</skip>
165-
</configuration>
166-
</execution>
167-
</executions>
168-
<dependencies>
169-
<dependency>
170-
<groupId>org.junit.platform</groupId>
171-
<artifactId>junit-platform-surefire-provider</artifactId>
172-
<version>${junit.platform.version}</version>
173-
</dependency>
174-
</dependencies>
175-
</plugin>
176157
</plugins>
177158
</pluginManagement>
178159
<finalName>spring-mvc-simple</finalName>

spring-security-mvc-login/src/main/java/com/baeldung/spring/MvcConfig.java

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package com.baeldung.spring;
22

33
import org.springframework.context.annotation.Bean;
4-
import org.springframework.context.annotation.ComponentScan;
54
import org.springframework.context.annotation.Configuration;
65
import org.springframework.web.servlet.ViewResolver;
76
import org.springframework.web.servlet.config.annotation.EnableWebMvc;

spring-security-rest-basic-auth/src/main/java/org/baeldung/client/RestTemplateFactory.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import org.springframework.beans.factory.FactoryBean;
55
import org.springframework.beans.factory.InitializingBean;
66
import org.springframework.http.client.ClientHttpRequestFactory;
7-
import org.springframework.http.client.support.BasicAuthorizationInterceptor;
7+
import org.springframework.http.client.support.BasicAuthenticationInterceptor;
88
import org.springframework.stereotype.Component;
99
import org.springframework.web.client.RestTemplate;
1010

@@ -38,7 +38,7 @@ public void afterPropertiesSet() {
3838
HttpHost host = new HttpHost("localhost", 8082, "http");
3939
final ClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactoryBasicAuth(host);
4040
restTemplate = new RestTemplate(requestFactory);
41-
restTemplate.getInterceptors().add(new BasicAuthorizationInterceptor("user1", "user1Pass"));
41+
restTemplate.getInterceptors().add(new BasicAuthenticationInterceptor("user1", "user1Pass"));
4242
}
4343

4444
}

spring-security-rest-basic-auth/src/main/java/org/baeldung/spring/WebConfig.java

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
99
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
1010
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
11-
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
1211

1312
@Configuration
1413
@EnableWebMvc

spring-security-rest-basic-auth/src/test/java/org/baeldung/SpringContextIntegrationTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
77

88
@RunWith(SpringJUnit4ClassRunner.class)
9-
@ContextConfiguration({ "/WebSecurityConfig.xml" })
9+
@ContextConfiguration({ "/webSecurityConfig.xml" })
1010
public class SpringContextIntegrationTest {
1111

1212
@Test

spring-security-rest/src/test/java/org/baeldung/web/FooLiveTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ private RequestSpecification givenAuth() {
2929
// }
3030
// return RestAssured.given().cookie("JSESSIONID", cookie);
3131
return RestAssured.given()
32-
.auth()
32+
.auth().preemptive()
3333
.basic("user", "userPass");
3434
}
3535

0 commit comments

Comments
 (0)