Skip to content

Commit e800388

Browse files
Meeravali1986eemeahs
andauthored
committed changes for springboot uplift 2.7.5 (#547)
* committed changes for springboot uplift 2.7.5 Co-authored-by: eemeahs <eemeahs@seliiuts03306.seli.gic.ericsson.se>
1 parent d4e4f20 commit e800388

File tree

6 files changed

+52
-7
lines changed

6 files changed

+52
-7
lines changed

pom.xml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@
1212
<parent>
1313
<groupId>org.springframework.boot</groupId>
1414
<artifactId>spring-boot-starter-parent</artifactId>
15-
<version>2.5.5</version>
15+
<version>2.7.5</version>
1616
<relativePath /> <!-- .. lookup parent from repository -->
1717
</parent>
18-
1918
<properties>
2019
<java.version>1.8</java.version>
2120
<springmvcRamlVersion>2.0.5</springmvcRamlVersion>
@@ -25,7 +24,7 @@
2524
<skipTests>false</skipTests>
2625
<skipITs>${skipTests}</skipITs>
2726
<skipUTs>${skipTests}</skipUTs>
28-
<springBootVersion>2.5.12</springBootVersion>
27+
<springBootVersion>2.7.5</springBootVersion>
2928
<springLdapVersion>2.3.4.RELEASE</springLdapVersion>
3029
<springSecurityVersion>5.5.2</springSecurityVersion>
3130
<springSessionVersion>2.5.0</springSessionVersion>
@@ -158,13 +157,13 @@
158157
<dependency>
159158
<groupId>org.mongodb</groupId>
160159
<artifactId>mongodb-driver-sync</artifactId>
161-
<version>4.3.2</version><!--$NO-MVN-MAN-VER$-->
160+
<version>4.6.1</version><!--$NO-MVN-MAN-VER$-->
162161
</dependency>
163162

164163
<dependency>
165164
<groupId>org.mongodb</groupId>
166165
<artifactId>mongodb-driver-core</artifactId>
167-
<version>4.3.2</version><!--$NO-MVN-MAN-VER$-->
166+
<version>4.6.1</version><!--$NO-MVN-MAN-VER$-->
168167
</dependency>
169168

170169
<dependency>

src/functionaltests/resources/application.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Configuration documentation can be found here:
22
# https://github.com/eiffel-community/eiffel-intelligence/blob/master/wiki/configuration.md
33
spring.application.name: eiffel-intelligence
4+
spring.mvc.pathmatch.matching-strategy: ANT_PATH_MATCHER
45
server.port: 8090
56

67
logging.level.root: OFF

src/integrationtests/resources/application.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Configuration documentation can be found here:
22
# https://github.com/eiffel-community/eiffel-intelligence/blob/master/wiki/configuration.md
33
spring.application.name: eiffel-intelligence
4+
spring.mvc.pathmatch.matching-strategy: ANT_PATH_MATCHER
45
server.port: 8090
56

67
logging.level.root: OFF

src/main/java/com/ericsson/ei/config/SpringAsyncConfig.java

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,29 @@
1616
*/
1717
package com.ericsson.ei.config;
1818

19+
import java.util.ArrayList;
20+
import java.util.Collection;
21+
import java.util.List;
1922
import java.util.concurrent.Executor;
2023

24+
import org.apache.commons.lang3.StringUtils;
2125
import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;
2226
import org.springframework.beans.factory.annotation.Value;
27+
import org.springframework.boot.actuate.autoconfigure.endpoint.web.CorsEndpointProperties;
28+
import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties;
29+
import org.springframework.boot.actuate.autoconfigure.web.server.ManagementPortType;
30+
import org.springframework.boot.actuate.endpoint.ExposableEndpoint;
31+
import org.springframework.boot.actuate.endpoint.web.EndpointLinksResolver;
32+
import org.springframework.boot.actuate.endpoint.web.EndpointMapping;
33+
import org.springframework.boot.actuate.endpoint.web.EndpointMediaTypes;
34+
import org.springframework.boot.actuate.endpoint.web.ExposableWebEndpoint;
35+
import org.springframework.boot.actuate.endpoint.web.WebEndpointsSupplier;
36+
import org.springframework.boot.actuate.endpoint.web.annotation.ControllerEndpointsSupplier;
37+
import org.springframework.boot.actuate.endpoint.web.annotation.ServletEndpointsSupplier;
38+
import org.springframework.boot.actuate.endpoint.web.servlet.WebMvcEndpointHandlerMapping;
39+
import org.springframework.context.annotation.Bean;
2340
import org.springframework.context.annotation.Configuration;
41+
import org.springframework.core.env.Environment;
2442
import org.springframework.scheduling.annotation.AsyncConfigurer;
2543
import org.springframework.scheduling.annotation.EnableAsync;
2644
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
@@ -54,4 +72,22 @@ public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() {
5472
// TODO Auto-generated method stub
5573
return null;
5674
}
75+
76+
@Bean
77+
public WebMvcEndpointHandlerMapping webEndpointServletHandlerMapping(WebEndpointsSupplier webEndpointsSupplier, ServletEndpointsSupplier servletEndpointsSupplier, ControllerEndpointsSupplier controllerEndpointsSupplier, EndpointMediaTypes endpointMediaTypes, CorsEndpointProperties corsProperties, WebEndpointProperties webEndpointProperties, Environment environment) {
78+
List<ExposableEndpoint<?>> allEndpoints = new ArrayList<>();
79+
Collection<ExposableWebEndpoint> webEndpoints = webEndpointsSupplier.getEndpoints();
80+
allEndpoints.addAll(webEndpoints);
81+
allEndpoints.addAll(servletEndpointsSupplier.getEndpoints());
82+
allEndpoints.addAll(controllerEndpointsSupplier.getEndpoints());
83+
String basePath = webEndpointProperties.getBasePath();
84+
EndpointMapping endpointMapping = new EndpointMapping(basePath);
85+
boolean shouldRegisterLinksMapping = this.shouldRegisterLinksMapping(webEndpointProperties, environment, basePath);
86+
return new WebMvcEndpointHandlerMapping(endpointMapping, webEndpoints, endpointMediaTypes, corsProperties.toCorsConfiguration(), new EndpointLinksResolver(allEndpoints, basePath), shouldRegisterLinksMapping, null);
87+
}
88+
89+
90+
private boolean shouldRegisterLinksMapping(WebEndpointProperties webEndpointProperties, Environment environment, String basePath) {
91+
return webEndpointProperties.getDiscovery().isEnabled() && (StringUtils.isNotEmpty(basePath) || ManagementPortType.get(environment).equals(ManagementPortType.DIFFERENT));
92+
}
5793
}

src/main/java/com/ericsson/ei/controller/model/ParseInstanceInfoEI.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import org.json.JSONArray;
2626
import org.springframework.beans.factory.annotation.Autowired;
2727
import org.springframework.beans.factory.annotation.Value;
28+
import org.springframework.context.annotation.Lazy;
2829
import org.springframework.core.env.Environment;
2930
import org.springframework.stereotype.Component;
3031

@@ -69,10 +70,12 @@ public class ParseInstanceInfoEI {
6970

7071
@Getter
7172
@Autowired
73+
@Lazy
7274
private List<MongoDbValues> mongodb;
7375

7476
@Getter
7577
@Autowired
78+
@Lazy
7679
private List<ThreadsValue> threads;
7780

7881
@Getter
@@ -81,10 +84,12 @@ public class ParseInstanceInfoEI {
8184

8285
@Getter
8386
@Autowired
87+
@Lazy
8488
private List<MailServerValues> mailServerValues;
8589

8690
@Getter
8791
@Autowired
92+
@Lazy
8893
private LdapValues ldap;
8994

9095
@Getter
@@ -158,6 +163,9 @@ public void init() throws IOException {
158163

159164
@Component
160165
private class LdapValues {
166+
public LdapValues() {
167+
// TODO Auto-generated constructor stub
168+
}
161169
@Getter
162170
@Value("${ldap.enabled}")
163171
private String ldapEnabled;

src/main/resources/application.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# https://github.com/eiffel-community/eiffel-intelligence/blob/master/wiki/configuration.md
33
spring.application.name: eiffel-intelligence
44
server.port: 8090
5-
5+
spring.mvc.pathmatch.matching-strategy: ANT_PATH_MATCHER
66
logging.level.root: OFF
77
logging.level.org.springframework.web: ERROR
88
logging.level.com.ericsson.ei: ERROR
@@ -58,7 +58,7 @@ spring.mail.password:
5858
spring.mail.properties.mail.smtp.auth: false
5959
spring.mail.properties.mail.smtp.starttls.enable: false
6060

61-
event.repository.url:
61+
event.repository.url:
6262
event.repository.shallow: true
6363

6464
ldap.enabled: false

0 commit comments

Comments
 (0)