I am trying to build my code and I am getting this error:
[WARNING] Unused declared dependencies found:
[WARNING] com:test-client:jar:v1.0-SNAPSHOT:compile
This is the configuration of the dependency plugin in my pom:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>analyze</id>
<goals>
<goal>analyze-only</goal>
</goals>
</execution>
</executions>
<configuration>
<!-- <usedDependencies>-->
<!-- <usedDependency>com:test-client</usedDependency>-->
<!-- </usedDependencies>-->
<failOnWarning>true</failOnWarning>
<ignoreNonCompile>true</ignoreNonCompile>
<ignoredUnusedDeclaredDependencies>
<!-- <ignoredUnusedDeclaredDependency>*:test-client:*</ignoredUnusedDeclaredDependency>-->
</ignoredUnusedDeclaredDependencies>
</configuration>
</plugin>
I tried to add the test-client to the flag ignoredUnsedDeclaredDependecy (see the commented part) but still getting error.
I tried to set the failOnWarning flag to false but also I get same warning.
When I added this section it works.
<usedDependencies>
<usedDependency>com:test-client</usedDependency>
</usedDependencies>
But why the 2 other flags are not being taken?
Note that I am working in a multi module project and this is a child pom of a parent pom.