ben-manes / gradle-versions-plugin

Gradle plugin to discover dependency updates
Apache License 2.0
3.86k stars 199 forks source link

consider to report about time to migrate #772

Closed nagkumar closed 1 year ago

nagkumar commented 1 year ago

image

In this JUnit 4.x is used, can this plugin also consider discovering and say Junit 5 is x years old, and code needs to be migrated as JUnit 4 is no more maintained..

Not with just Junit 4 but with any others that are deprecated or going out of scope etc..

Just a suggestion to consider not sure how feasible it is..

Few Inputs to this regard are

Maven does report with few if they are deprecated & outdated

https://mvnrepository.com/search?q=deprecated https://mvnrepository.com/search?q=outdated

Also from the date of publishing if it is more than x configurable years etc..and/or github activity in the last few weeks etc..

I really like your plugin, lot of scope to be part of every grade project by default.

ben-manes commented 1 year ago

Thanks for the kind words! I'm glad it's helping you. 🙂

That is merely a search on the description xml element in the pom file, e.g. hamcrest-core-2.2.pom. A text search is inaccurate since it also picks up the Leiningen build system's ancient plugin that describes itself as Check your Projects for outdated Dependencies. Unfortunately there is no metadata in the pom xml to indicate the release age or status. We cannot rely on the file's timestamp due to repository cache proxies.

JUnit changes to a different maven coordinate between major versions, so that transition is unknown from a tooling perspective. The effort required is dependency and project specific. For example, JUnit5 is unable to handle modestly large test suites that JUnit3 and JUnit4 easily scale to due to unresolved memory leaks, so I cannot migrate my own projects. At best one can try modernization plugins which try to detect and sometimes auto-fix projects with stale code and maintain a listing of what is outdated. That is out-of-scope for this plugin.

ben-manes commented 4 months ago

hey @nagkumar, it seems libyear does exactly what you wanted.