In a mvn project where I am utilizing maven-dependency-plugin
to detect unused dependencies, there is seemingly no dependency scope
I can specify for Google's AutoValue (com.google.auto.value:auto-value
) to that will convince the plugin that the dependency is being used in spite of the fact that annotations from the package are being used (e.g. @AutoValue
) and the project won't build if auto-value
is excluded.
Now one solution is simply adding a configuration entry to my plugin:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<configuration>
<usedDependencies>
<usedDependency>com.google.auto.value:auto-value</usedDependency>
</usedDependencies>
</configuration>
</plugin>
But I would be curious to know whether it's possible to configure either the maven-dependency-plugin
or the dependency
entry for auto-value
in a way that would detect usage of the dependency per its annotations?
My suspicion is that this isn't possible because the RetentionPolicy
of the annotations I'm using from auto-value are of RetentionPolicy.SOURCE
and are discarded by the compiler. Is this correct?