gradle-versions-plugin icon indicating copy to clipboard operation
gradle-versions-plugin copied to clipboard

Option to exclude test dependencies

Open jameskleeh opened this issue 5 years ago • 4 comments

Is there an option to do so? If not, how could one achieve this?

jameskleeh avatar May 29 '20 16:05 jameskleeh

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 avatar May 29 '20 16:05 ben-manes

@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.

jameskleeh avatar May 29 '20 17:05 jameskleeh

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,

  1. Allow a custom filter to decide if the configuration should be evaluated
  2. 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.

ben-manes avatar May 30 '20 06:05 ben-manes

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.

mkbaldwin avatar Apr 25 '22 16:04 mkbaldwin