gradle-versions-plugin
gradle-versions-plugin copied to clipboard
Option to exclude test dependencies
Is there an option to do so? If not, how could one achieve this?
No, we scan all configurations. I suppose a setting could be added to filter with. Why would you not want test dependencies updates?
@ben-manes Because having to modify test dependencies each time they are upgraded costs time. As long as my tests pass I don't care if they are using the latest version. Say a new version comes out with a bug, then I would have to go through the steps to pin the version which is undesirable.
I suppose you could generate your own report rather than use ours. That can be done using either a custom output formatter or by post-processing the json results.
The possible feature options would be maybe,
- Allow a custom filter to decide if the configuration should be evaluated
- Add the configurations that the dependency belongs to in the result
The first would filter during the report generation, whereas the latter would let you filter from the results. In both it would require evaluating the configuration, since that is how dependencies are bundled (rather than a phase like compile or test).
Another option is to specify a resolution strategy that rejects anything newer for those dependencies, causing it to be considered up-to-date. That is a little confusing as a lie, so you might forget later.
Adding the configurations that the dependency belongs to into the report output would be useful. That way you can distinguish test / plugin dependencies from ones bundled into the application.
My use case for the plugin output is mostly focused on generating reports for documentation purposes... being able to exclude dependencies that aren't bundled into the application would be useful to eliminate confusion by people looking at the documentation later down the road.