Maven - installing artifacts to a local repository in workspace

后端 未结 4 1209
轮回少年
轮回少年 2020-12-08 10:39

I\'d like to have a way in which \'mvn install\' puts files in a repository folder under my source (checkout) root, while using 3rd party dependencies from ~/.m2/repository.

4条回答
  •  庸人自扰
    2020-12-08 11:25

    This is not possible with the command line client but you can create more complex repository layouts with a Maven repository server like Nexus.

    The reason why it's not possible is that Maven allows to nest projects and most of them will reference each other, so installing each artifact in a different repository would lead to lots of searches on your local hard disk (or to failed builds when you start a build in a sub-project).

提交回复
热议问题