BAEL-3929: made changes per code/article review.
This commit is contained in:
parent
b14ab5ed7a
commit
f3ce1554c9
|
@ -6,6 +6,13 @@
|
|||
<artifactId>maven-unused-dependencies</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
|
||||
<properties>
|
||||
<commons-collections.version>3.2.2</commons-collections.version>
|
||||
<slf4j-api.version>1.7.25</slf4j-api.version>
|
||||
<maven-dependency-plugin.version>3.1.1</maven-dependency-plugin.version>
|
||||
<maven-compiler-plugin.version>3.1</maven-compiler-plugin.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>commons-collections</groupId>
|
||||
|
@ -37,11 +44,4 @@
|
|||
</plugins>
|
||||
</build>
|
||||
|
||||
<properties>
|
||||
<commons-collections.version>3.2.2</commons-collections.version>
|
||||
<slf4j-api.version>1.7.25</slf4j-api.version>
|
||||
<maven-dependency-plugin.version>3.1.1</maven-dependency-plugin.version>
|
||||
<maven-compiler-plugin.version>3.1</maven-compiler-plugin.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
|
@ -1,20 +0,0 @@
|
|||
package com.baeldung;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class Main {
|
||||
|
||||
public static void main(String[] args) {
|
||||
Map<String, String> map = new HashMap<>();
|
||||
map.put("Dallas", "Texas");
|
||||
map.put("Green Bay", "Wisconsin");
|
||||
map.put("Seattle", "Washington");
|
||||
|
||||
LoggerFactory.getLogger(Main.class)
|
||||
.info("Map: {}", map);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
package com.baeldung;
|
||||
|
||||
public class ReflectionMain {
|
||||
|
||||
public static void main(String[] args) {
|
||||
ClassLoader classLoader = Main.class.getClassLoader();
|
||||
try {
|
||||
System.out.println(classLoader.loadClass("org.apache.commons.collections.CollectionUtils")
|
||||
.getSimpleName());
|
||||
} catch (ClassNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package com.baeldung.mavendependencyplugin;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class UnusedDependenciesExample {
|
||||
|
||||
/**
|
||||
* When the Maven dependency analyzer analyzes the code, it will see that the slf4j dependency is being used in this method.
|
||||
*
|
||||
* @return the slf4j {@link Logger}.
|
||||
*/
|
||||
public Logger getLogger() {
|
||||
return LoggerFactory.getLogger(UnusedDependenciesExample.class);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue