How to clean old dependencies from maven repositories?

前端 未结 9 1849
小鲜肉
小鲜肉 2020-12-14 05:19

I have too many files in .m2 folder where maven stores downloaded dependencies. Is there a way to clean all old dependencies? For example, if there is a dependency with 3 di

9条回答
  •  Happy的楠姐
    2020-12-14 06:08

    I came up with a utility and hosted on GitHub to clean old versions of libraries in the local Maven repository. The utility, on its default execution removes all older versions of artifacts leaving only the latest ones. Optionally, it can remove all snapshots, sources, javadocs, and also groups or artifacts can be forced / excluded in this process. This cross platform also supports date based removal based on last access / download dates.

    https://github.com/techpavan/mvn-repo-cleaner

提交回复
热议问题