Skip to content

Commit 51eb6a3

Browse files
committed
Merge branch 'gh413_spring_boot_1_4'
Addressed to #413
2 parents fc72d3b + d7dcfed commit 51eb6a3

30 files changed

+239
-195
lines changed

pom.xml

Lines changed: 44 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
<version>${slf4j.version}</version>
4141
</dependency>
4242

43-
<!-- https://github.com/spring-projects/spring-boot/blob/v1.3.7.RELEASE/spring-boot-starters/spring-boot-starter/pom.xml -->
43+
<!-- https://github.com/spring-projects/spring-boot/blob/v1.4.1.RELEASE/spring-boot-starters/spring-boot-starter/pom.xml -->
4444
<dependency>
4545
<groupId>org.springframework.boot</groupId>
4646
<artifactId>spring-boot-starter</artifactId>
@@ -52,7 +52,7 @@
5252
</exclusions>
5353
</dependency>
5454

55-
<!-- https://github.com/spring-projects/spring-boot/blob/v1.3.7.RELEASE/spring-boot-starters/spring-boot-starter-jdbc/pom.xml -->
55+
<!-- https://github.com/spring-projects/spring-boot/blob/v1.4.1.RELEASE/spring-boot-starters/spring-boot-starter-jdbc/pom.xml -->
5656
<dependency>
5757
<groupId>org.springframework.boot</groupId>
5858
<artifactId>spring-boot-starter-jdbc</artifactId>
@@ -64,7 +64,7 @@
6464
</exclusions>
6565
</dependency>
6666

67-
<!-- https://github.com/spring-projects/spring-boot/blob/v1.3.7.RELEASE/spring-boot-starters/spring-boot-starter-jetty/pom.xml -->
67+
<!-- https://github.com/spring-projects/spring-boot/blob/v1.4.1.RELEASE/spring-boot-starters/spring-boot-starter-jetty/pom.xml -->
6868
<dependency>
6969
<groupId>org.springframework.boot</groupId>
7070
<artifactId>spring-boot-starter-jetty</artifactId>
@@ -80,25 +80,25 @@
8080
</exclusions>
8181
</dependency>
8282

83-
<!-- https://github.com/spring-projects/spring-boot/blob/v1.3.7.RELEASE/spring-boot-starters/spring-boot-starter-logging/pom.xml -->
83+
<!-- https://github.com/spring-projects/spring-boot/blob/v1.4.1.RELEASE/spring-boot-starters/spring-boot-starter-logging/pom.xml -->
8484
<dependency>
8585
<groupId>org.springframework.boot</groupId>
8686
<artifactId>spring-boot-starter-logging</artifactId>
8787
</dependency>
8888

89-
<!-- https://github.com/spring-projects/spring-boot/blob/v1.3.7.RELEASE/spring-boot-starters/spring-boot-starter-mail/pom.xml -->
89+
<!-- https://github.com/spring-projects/spring-boot/blob/v1.4.1.RELEASE/spring-boot-starters/spring-boot-starter-mail/pom.xml -->
9090
<dependency>
9191
<groupId>org.springframework.boot</groupId>
9292
<artifactId>spring-boot-starter-mail</artifactId>
9393
</dependency>
9494

95-
<!-- https://github.com/spring-projects/spring-boot/blob/v1.3.7.RELEASE/spring-boot-starters/spring-boot-starter-security/pom.xml -->
95+
<!-- https://github.com/spring-projects/spring-boot/blob/v1.4.1.RELEASE/spring-boot-starters/spring-boot-starter-security/pom.xml -->
9696
<dependency>
9797
<groupId>org.springframework.boot</groupId>
9898
<artifactId>spring-boot-starter-security</artifactId>
9999
</dependency>
100100

101-
<!-- https://github.com/spring-projects/spring-boot/blob/v1.3.7.RELEASE/spring-boot-starters/spring-boot-starter-thymeleaf/pom.xml -->
101+
<!-- https://github.com/spring-projects/spring-boot/blob/v1.4.1.RELEASE/spring-boot-starters/spring-boot-starter-thymeleaf/pom.xml -->
102102
<dependency>
103103
<groupId>org.springframework.boot</groupId>
104104
<artifactId>spring-boot-starter-thymeleaf</artifactId>
@@ -110,13 +110,13 @@
110110
</exclusions>
111111
</dependency>
112112

113-
<!-- https://github.com/spring-projects/spring-boot/blob/v1.3.7.RELEASE/spring-boot-starters/spring-boot-starter-validation/pom.xml -->
113+
<!-- https://github.com/spring-projects/spring-boot/blob/v1.4.1.RELEASE/spring-boot-starters/spring-boot-starter-validation/pom.xml -->
114114
<dependency>
115115
<groupId>org.springframework.boot</groupId>
116116
<artifactId>spring-boot-starter-validation</artifactId>
117117
</dependency>
118118

119-
<!-- https://github.com/spring-projects/spring-boot/blob/v1.3.7.RELEASE/spring-boot-starters/spring-boot-starter-web/pom.xml -->
119+
<!-- https://github.com/spring-projects/spring-boot/blob/v1.4.1.RELEASE/spring-boot-starters/spring-boot-starter-web/pom.xml -->
120120
<dependency>
121121
<groupId>org.springframework.boot</groupId>
122122
<artifactId>spring-boot-starter-web</artifactId>
@@ -271,7 +271,7 @@
271271
<dependency>
272272
<groupId>org.seleniumhq.selenium</groupId>
273273
<artifactId>htmlunit-driver</artifactId>
274-
<version>${selenium.htmlunit.version}</version>
274+
<version>${htmlunit.version}</version>
275275
<scope>test</scope>
276276
<exclusions>
277277
<exclusion>
@@ -308,6 +308,16 @@
308308
<scope>test</scope>
309309
</dependency>
310310

311+
<!--
312+
For ConfigFileApplicationContextInitializer class.
313+
https://github.com/spring-projects/spring-boot/blob/v1.4.1.RELEASE/spring-boot-test/pom.xml
314+
-->
315+
<dependency>
316+
<groupId>org.springframework.boot</groupId>
317+
<artifactId>spring-boot-test</artifactId>
318+
<scope>test</scope>
319+
</dependency>
320+
311321
<dependency>
312322
<groupId>org.subethamail</groupId>
313323
<artifactId>subethasmtp</artifactId>
@@ -332,10 +342,10 @@
332342
</dependencies>
333343

334344
<parent>
335-
<!-- https://github.com/spring-projects/spring-boot/blob/v1.3.7.RELEASE/spring-boot-starters/spring-boot-starter-parent/pom.xml -->
345+
<!-- https://github.com/spring-projects/spring-boot/blob/v1.4.1.RELEASE/spring-boot-starters/spring-boot-starter-parent/pom.xml -->
336346
<groupId>org.springframework.boot</groupId>
337347
<artifactId>spring-boot-starter-parent</artifactId>
338-
<version>1.3.7.RELEASE</version>
348+
<version>1.4.1.RELEASE</version>
339349
</parent>
340350

341351
<properties>
@@ -346,10 +356,10 @@
346356
<checkstyle.plugin.version>2.17</checkstyle.plugin.version>
347357
<clean.plugin.version>3.0.0</clean.plugin.version>
348358

349-
<!-- Redefine default value from spring-boot-dependencies (https://git.io/vKAiK) -->
359+
<!-- Redefine default value from spring-boot-dependencies (https://github.com/spring-projects/spring-boot/blob/v1.4.1.RELEASE/spring-boot-dependencies/pom.xml) -->
350360
<commons-dbcp.version>1.4</commons-dbcp.version>
351361

352-
<!-- Redefine default value from spring-boot-dependencies (https://git.io/vKAiK) -->
362+
<!-- Redefine default value from spring-boot-dependencies (https://github.com/spring-projects/spring-boot/blob/v1.4.1.RELEASE/spring-boot-dependencies/pom.xml) -->
353363
<commons-pool.version>1.5.4</commons-pool.version>
354364

355365
<commons.lang.version>3.4</commons.lang.version>
@@ -361,43 +371,48 @@
361371
<gmaven.plugin.version>1.4</gmaven.plugin.version>
362372
<gmaven.runtime.plugin.version>1.5</gmaven.runtime.plugin.version>
363373

364-
<!-- Redefine default value from spring-boot-dependencies (https://git.io/vKAiK) -->
374+
<!-- Redefine default value from spring-boot-dependencies (https://github.com/spring-projects/spring-boot/blob/v1.4.1.RELEASE/spring-boot-dependencies/pom.xml) -->
365375
<groovy.version>2.0.8</groovy.version>
366376

367-
<!-- Redefine default value from spring-boot-dependencies (https://git.io/vKAiK) -->
377+
<!-- Redefine default value from spring-boot-dependencies (https://github.com/spring-projects/spring-boot/blob/v1.4.1.RELEASE/spring-boot-dependencies/pom.xml) -->
368378
<h2.version>1.4.192</h2.version>
369379

370-
<!-- Redefine default value from spring-boot-dependencies (https://git.io/vKAiK) -->
380+
<!-- Redefine default value from spring-boot-dependencies (https://github.com/spring-projects/spring-boot/blob/v1.4.1.RELEASE/spring-boot-dependencies/pom.xml) -->
371381
<hibernate-validator.version>5.2.4.Final</hibernate-validator.version>
372382

383+
<!-- Redefine default value from spring-boot-dependencies (https://github.com/spring-projects/spring-boot/blob/v1.4.1.RELEASE/spring-boot-dependencies/pom.xml) -->
384+
<htmlunit.version>2.20</htmlunit.version>
385+
373386
<jacoco.plugin.version>0.7.7.201606060606</jacoco.plugin.version>
374387
<jasmine.plugin.version>2.2</jasmine.plugin.version>
375388

376-
<!-- Redefine default value from spring-boot-starter-parent (https://git.io/vKAiy) -->
389+
<!-- Redefine default value from spring-boot-starter-parent (https://github.com/spring-projects/spring-boot/blob/v1.4.1.RELEASE/spring-boot-starters/spring-boot-starter-parent/pom.xml) -->
377390
<java.version>1.8</java.version>
378391

379392
<javadoc.plugin.version>2.10.4</javadoc.plugin.version>
380393

381-
<!-- Redefine default value from spring-boot-dependencies (https://git.io/vKAiK) -->
394+
<!-- Redefine default value from spring-boot-dependencies (https://github.com/spring-projects/spring-boot/blob/v1.4.1.RELEASE/spring-boot-dependencies/pom.xml) -->
382395
<javax-mail.version>1.5.4</javax-mail.version>
383396

384397
<javax.validation.version>1.1.0.Final</javax.validation.version>
385398

386-
<!-- Redefine default value from spring-boot-dependencies (https://git.io/vKAiK) -->
399+
<!-- Redefine default value from spring-boot-dependencies (https://github.com/spring-projects/spring-boot/blob/v1.4.1.RELEASE/spring-boot-dependencies/pom.xml) -->
387400
<jetty.version>9.2.18.v20160721</jetty.version>
388401

389402
<!-- Don't forget to update version in the Url class -->
390403
<jquery.version>1.9.1</jquery.version>
391404

392405
<license.plugin.version>1.9.0</license.plugin.version>
393406

394-
<!-- Redefine default value from spring-boot-dependencies (https://git.io/vKAiK) -->
407+
<!-- Redefine default value from spring-boot-dependencies (https://github.com/spring-projects/spring-boot/blob/v1.4.1.RELEASE/spring-boot-dependencies/pom.xml) -->
395408
<liquibase.version>3.5.1</liquibase.version>
396409

410+
<!-- Redefine default value from spring-boot-dependencies (https://github.com/spring-projects/spring-boot/blob/v1.4.1.RELEASE/spring-boot-dependencies/pom.xml) -->
397411
<lombok.version>1.16.10</lombok.version>
412+
398413
<minify.plugin.version>1.7.4</minify.plugin.version>
399414

400-
<!-- Redefine default value from spring-boot-dependencies (https://git.io/vKAiK) -->
415+
<!-- Redefine default value from spring-boot-dependencies (https://github.com/spring-projects/spring-boot/blob/v1.4.1.RELEASE/spring-boot-dependencies/pom.xml) -->
401416
<mysql.version>5.1.39</mysql.version>
402417

403418
<native2ascii.plugin.version>1.0-beta-1</native2ascii.plugin.version>
@@ -407,35 +422,35 @@
407422
<!-- Don't forget to update version in the Url class -->
408423
<selectizejs.version>0.12.3</selectizejs.version>
409424

410-
<selenium.htmlunit.version>2.21</selenium.htmlunit.version>
425+
<!-- Redefine default value from spring-boot-dependencies (https://github.com/spring-projects/spring-boot/blob/v1.4.1.RELEASE/spring-boot-dependencies/pom.xml) -->
411426
<selenium.version>2.53.1</selenium.version>
412427

413-
<!-- Redefine default value from spring-boot-dependencies (https://git.io/vKAiK) -->
428+
<!-- Redefine default value from spring-boot-dependencies (https://github.com/spring-projects/spring-boot/blob/v1.4.1.RELEASE/spring-boot-dependencies/pom.xml) -->
414429
<servlet-api.version>3.1.0</servlet-api.version>
415430

416431
<skipUnitTests>false</skipUnitTests>
417432

418-
<!-- Redefine default value from spring-boot-dependencies (https://git.io/vKAiK) -->
433+
<!-- Redefine default value from spring-boot-dependencies (https://github.com/spring-projects/spring-boot/blob/v1.4.1.RELEASE/spring-boot-dependencies/pom.xml) -->
419434
<slf4j.version>1.7.21</slf4j.version>
420435

421436
<sortpom.plugin.version>2.5.0</sortpom.plugin.version>
422437

423-
<!-- Redefine default value from spring-boot-dependencies (https://git.io/vKAiK) -->
438+
<!-- Redefine default value from spring-boot-dependencies (https://github.com/spring-projects/spring-boot/blob/v1.4.1.RELEASE/spring-boot-dependencies/pom.xml) -->
424439
<spock.version>1.0-groovy-2.0</spock.version>
425440

426-
<!-- Define default value for spring-boot-starter-parent (https://git.io/vKAiy) -->
441+
<!-- Define default value for spring-boot-starter-parent (https://github.com/spring-projects/spring-boot/blob/v1.4.1.RELEASE/spring-boot-starters/spring-boot-starter-parent/pom.xml) -->
427442
<start-class>ru.mystamps.web.support.spring.boot.ApplicationBootstrap</start-class>
428443

429444
<subethasmtp.version>3.1.7</subethasmtp.version>
430445
<surefire.plugin.version>2.19.1</surefire.plugin.version>
431446
<testng.version>6.8.8</testng.version>
432447

433-
<!-- Redefine default value from spring-boot-dependencies (https://git.io/vKAiK) -->
448+
<!-- Redefine default value from spring-boot-dependencies (https://github.com/spring-projects/spring-boot/blob/v1.4.1.RELEASE/spring-boot-dependencies/pom.xml) -->
434449
<thymeleaf-extras-springsecurity4.version>2.1.2.RELEASE</thymeleaf-extras-springsecurity4.version>
435450

436451
<thymeleaf.togglz.version>1.1.0.RELEASE</thymeleaf.togglz.version>
437452

438-
<!-- Redefine default value from spring-boot-dependencies (https://git.io/vKAiK) -->
453+
<!-- Redefine default value from spring-boot-dependencies (https://github.com/spring-projects/spring-boot/blob/v1.4.1.RELEASE/spring-boot-dependencies/pom.xml) -->
439454
<thymeleaf.version>2.1.5.RELEASE</thymeleaf.version>
440455

441456
<togglz.version>2.3.0.Final</togglz.version>

src/main/java/ru/mystamps/web/config/ControllersConfig.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,21 @@
1717
*/
1818
package ru.mystamps.web.config;
1919

20-
import org.springframework.beans.factory.annotation.Autowired;
2120
import org.springframework.context.MessageSource;
2221
import org.springframework.context.annotation.Bean;
2322
import org.springframework.context.annotation.Configuration;
2423

24+
import lombok.RequiredArgsConstructor;
25+
2526
// CheckStyle: ignore AvoidStarImportCheck for next 1 line
2627
import ru.mystamps.web.controller.*; // NOPMD: UnusedImports
2728

2829
@Configuration
30+
@RequiredArgsConstructor
2931
public class ControllersConfig {
3032

31-
@Autowired
32-
private ServicesConfig servicesConfig;
33-
34-
@Autowired
35-
private MessageSource messageSource;
33+
private final ServicesConfig servicesConfig;
34+
private final MessageSource messageSource;
3635

3736
@Bean
3837
public AccountController getAccountController() {

src/main/java/ru/mystamps/web/config/DaoConfig.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,25 @@
1717
*/
1818
package ru.mystamps.web.config;
1919

20-
import org.springframework.beans.factory.annotation.Autowired;
2120
import org.springframework.context.annotation.Bean;
2221
import org.springframework.context.annotation.Configuration;
2322
import org.springframework.context.annotation.PropertySource;
2423
import org.springframework.core.env.Environment;
2524
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
2625

26+
import lombok.RequiredArgsConstructor;
27+
2728
// CheckStyle: ignore AvoidStarImportCheck for next 2 lines
2829
import ru.mystamps.web.dao.*; // NOPMD: UnusedImports
2930
import ru.mystamps.web.dao.impl.*; // NOPMD: UnusedImports
3031

3132
@Configuration
3233
@PropertySource("classpath:/sql/stamps_catalog_dao_queries.properties")
34+
@RequiredArgsConstructor
3335
public class DaoConfig {
3436

35-
@Autowired
36-
private NamedParameterJdbcTemplate jdbcTemplate;
37-
38-
@Autowired
39-
private Environment env;
37+
private final NamedParameterJdbcTemplate jdbcTemplate;
38+
private final Environment env;
4039

4140
@Bean
4241
public CategoryDao getCategoryDao() {

src/main/java/ru/mystamps/web/config/MvcConfig.java

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,12 @@
2020
import java.util.List;
2121
import java.util.Locale;
2222

23-
import org.springframework.beans.factory.annotation.Autowired;
2423
import org.springframework.context.annotation.Bean;
2524
import org.springframework.context.annotation.Configuration;
2625
import org.springframework.context.annotation.Import;
2726
import org.springframework.context.support.ReloadableResourceBundleMessageSource;
2827
import org.springframework.format.FormatterRegistry;
2928
import org.springframework.scheduling.annotation.EnableScheduling;
30-
import org.springframework.util.AntPathMatcher;
3129
import org.springframework.validation.Validator;
3230
import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean;
3331
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
@@ -41,17 +39,19 @@
4139
import org.springframework.web.servlet.i18n.LocaleChangeInterceptor;
4240
import org.springframework.web.servlet.i18n.SessionLocaleResolver;
4341

42+
import lombok.RequiredArgsConstructor;
43+
4444
import ru.mystamps.web.Url;
4545
import ru.mystamps.web.controller.converter.LinkEntityDtoGenericConverter;
4646
import ru.mystamps.web.support.spring.security.CurrentUserArgumentResolver;
4747

4848
@Configuration
4949
@EnableScheduling
5050
@Import(ControllersConfig.class)
51+
@RequiredArgsConstructor
5152
public class MvcConfig extends WebMvcConfigurerAdapter {
5253

53-
@Autowired
54-
private ServicesConfig servicesConfig;
54+
private final ServicesConfig servicesConfig;
5555

5656
@Override
5757
public void addFormatters(FormatterRegistry registry) {
@@ -119,13 +119,6 @@ public void addInterceptors(InterceptorRegistry registry) {
119119

120120
@Override
121121
public void configurePathMatch(PathMatchConfigurer configurer) {
122-
// This is a temporary guard against CVE-2016-5007.
123-
// Should be removed after upgrading to Spring MVC 4.3.1+ and Spring Security 4.1.1+.
124-
// See also: http://pivotal.io/security/cve-2016-5007
125-
AntPathMatcher pathMatcher = new AntPathMatcher();
126-
pathMatcher.setTrimTokens(false);
127-
configurer.setPathMatcher(pathMatcher);
128-
129122
// If enabled a method mapped to "/users" also matches to "/users/"
130123
configurer.setUseTrailingSlashMatch(false);
131124
// If enabled a method mapped to "/users" also matches to "/users.*"

src/main/java/ru/mystamps/web/config/ServicesConfig.java

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,39 +19,30 @@
1919

2020
import java.util.Locale;
2121

22-
import org.springframework.beans.factory.annotation.Autowired;
2322
import org.springframework.context.MessageSource;
2423
import org.springframework.context.annotation.Bean;
2524
import org.springframework.context.annotation.Configuration;
2625
import org.springframework.core.env.Environment;
2726
import org.springframework.mail.javamail.JavaMailSender;
2827
import org.springframework.scheduling.annotation.EnableAsync;
2928

29+
import lombok.RequiredArgsConstructor;
30+
3031
// CheckStyle: ignore AvoidStarImportCheck for next 1 line
3132
import ru.mystamps.web.service.*; // NOPMD: UnusedImports
3233
import ru.mystamps.web.support.spring.security.SecurityConfig;
3334

3435
@Configuration
3536
@EnableAsync
37+
@RequiredArgsConstructor
3638
public class ServicesConfig {
3739

38-
@Autowired
39-
private DaoConfig daoConfig;
40-
41-
@Autowired
42-
private SecurityConfig securityConfig;
43-
44-
@Autowired
45-
private StrategiesConfig strategiesConfig;
46-
47-
@Autowired
48-
private JavaMailSender mailSender;
49-
50-
@Autowired
51-
private Environment env;
52-
53-
@Autowired
54-
private MessageSource messageSource;
40+
private final DaoConfig daoConfig;
41+
private final SecurityConfig securityConfig;
42+
private final StrategiesConfig strategiesConfig;
43+
private final JavaMailSender mailSender;
44+
private final Environment env;
45+
private final MessageSource messageSource;
5546

5647
@Bean
5748
public SuspiciousActivityService getSuspiciousActivityService() {

0 commit comments

Comments
 (0)