JAVA-49: Moved maven-unused-dependencies to maven-modules
This commit is contained in:
parent
dbb25da0b0
commit
d9c46907d8
|
@ -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)
|
|
@ -0,0 +1,47 @@
|
|||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.baeldung</groupId>
|
||||
<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.2</maven-dependency-plugin.version>
|
||||
<maven-compiler-plugin.version>3.1</maven-compiler-plugin.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>commons-collections</groupId>
|
||||
<artifactId>commons-collections</artifactId>
|
||||
<version>${commons-collections.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
<version>${slf4j-api.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>${maven-compiler-plugin.version}</version>
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<version>${maven-dependency-plugin.version}</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
|
@ -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