diff options
author | William Reehil <william.reehil@att.com> | 2020-07-01 19:13:36 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-07-01 19:13:36 +0000 |
commit | 55b5686e80479b217be90aef4a299d6c1d8ff8f5 (patch) | |
tree | 9b764959b235a5f0628133d91428ca021414332b | |
parent | 5f2f79ec59a88c8d8244af1892a3e5b33d85aacd (diff) | |
parent | 02f5d9e2c02c0b9fffdc494a9b7c87e0a4f7e000 (diff) |
Merge "MongoConfig - Removed Sonar warnings"
-rw-r--r-- | pom.xml | 16 | ||||
-rw-r--r-- | src/main/java/org/onap/aai/cacher/common/MongoConfig.java | 7 |
2 files changed, 6 insertions, 17 deletions
@@ -279,11 +279,6 @@ <version>1.18</version> </dependency> <dependency> - <groupId>org.apache.commons</groupId> - <artifactId>commons-compress</artifactId> - <version>1.18</version> - </dependency> - <dependency> <groupId>org.mongodb</groupId> <artifactId>mongodb-driver</artifactId> <version>3.6.2</version> @@ -364,10 +359,6 @@ <version>2.24</version> </dependency> <dependency> - <groupId>org.json</groupId> - <artifactId>json</artifactId> - </dependency> - <dependency> <groupId>com.googlecode.json-simple</groupId> <artifactId>json-simple</artifactId> <version>1.1.1</version> @@ -555,12 +546,9 @@ <artifactId>maven-dependency-plugin</artifactId> </plugin> <plugin> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-maven-plugin</artifactId> - </plugin> - <plugin> <artifactId>exec-maven-plugin</artifactId> <groupId>org.codehaus.mojo</groupId> + <version>3.0.0</version> </plugin> <plugin> <groupId>org.springframework.boot</groupId> @@ -603,10 +591,12 @@ <plugin> <groupId>com.github.kongchen</groupId> <artifactId>swagger-maven-plugin</artifactId> + <version>3.1.8</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> + <version>3.2.0</version> <configuration> <additionalparam>-Xdoclint:none</additionalparam> </configuration> diff --git a/src/main/java/org/onap/aai/cacher/common/MongoConfig.java b/src/main/java/org/onap/aai/cacher/common/MongoConfig.java index 5c1a541..ca063a7 100644 --- a/src/main/java/org/onap/aai/cacher/common/MongoConfig.java +++ b/src/main/java/org/onap/aai/cacher/common/MongoConfig.java @@ -48,7 +48,7 @@ import java.io.IOException; @Configuration public class MongoConfig { - private final static EELFLogger EELF_LOGGER = EELFManager.getInstance().getLogger(MongoConfig.class); + private static final EELFLogger EELF_LOGGER = EELFManager.getInstance().getLogger(MongoConfig.class); @Value("${mongodb.host}") private String MONGO_DB_HOST; @@ -61,9 +61,8 @@ public class MongoConfig { @Bean public MongoClient mongoClient(MongodProcess mongodProcess) { - try { - // To connect to mongodb server - MongoClient mongoC = new MongoClient(MONGO_DB_HOST, MONGO_DB_PORT); + // To connect to mongodb server + try (MongoClient mongoC = new MongoClient(MONGO_DB_HOST, MONGO_DB_PORT)) { // Now connect to your databases EELF_LOGGER.info("Connect to database successfully"); |