diff --git a/maven-modules/maven-unused-dependencies/README.md b/maven-modules/maven-unused-dependencies/README.md new file mode 100644 index 0000000000..53897e8227 --- /dev/null +++ b/maven-modules/maven-unused-dependencies/README.md @@ -0,0 +1,7 @@ +## Apache Maven + +This module contains articles about Unused Maven Dependencies. + +### Relevant Articles + +- [Find Unused Maven Dependencies](https://www.baeldung.com/maven-unused-dependencies) diff --git a/maven-modules/maven-unused-dependencies/pom.xml b/maven-modules/maven-unused-dependencies/pom.xml new file mode 100644 index 0000000000..825858e481 --- /dev/null +++ b/maven-modules/maven-unused-dependencies/pom.xml @@ -0,0 +1,47 @@ + + 4.0.0 + com.baeldung + maven-unused-dependencies + 0.0.1-SNAPSHOT + + + 3.2.2 + 1.7.25 + 3.1.2 + 3.1 + + + + + commons-collections + commons-collections + ${commons-collections.version} + + + org.slf4j + slf4j-api + ${slf4j-api.version} + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + 1.8 + 1.8 + + + + maven-dependency-plugin + ${maven-dependency-plugin.version} + + + + + \ No newline at end of file diff --git a/maven-modules/maven-unused-dependencies/src/main/java/com/baeldung/mavendependencyplugin/UnusedDependenciesExample.java b/maven-modules/maven-unused-dependencies/src/main/java/com/baeldung/mavendependencyplugin/UnusedDependenciesExample.java new file mode 100644 index 0000000000..c9390880ed --- /dev/null +++ b/maven-modules/maven-unused-dependencies/src/main/java/com/baeldung/mavendependencyplugin/UnusedDependenciesExample.java @@ -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); + } + +}