In the mvn project, where I use maven-dependency-plugin to detect unused dependencies, there seems to be no scope dependency that I can specify for Google AutoValue ( com.google.auto.value:auto-value ) to convince the plugin to that the dependency is used despite the fact that annotations from the package are used (for example, @AutoValue ), and the project will not be built if auto-value excluded.
Now one solution just adds 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 interested to know if it is possible to configure the maven-dependency-plugin or dependency record for auto-value in such a way as to detect a dependency dependency on its annotations?
My suspicion is that this is not possible because the RetentionPolicy annotations that I use from the automatic value have RetentionPolicy.SOURCE and are discarded by the compiler. Is it correct?
source share