Set the maven local repository location in a pom.xml file?

后端 未结 2 1137
深忆病人
深忆病人 2021-01-05 02:27

It\'s possible to set the maven local repository in settings.xml:

${user.home}/.m2/repository
<
2条回答
  •  無奈伤痛
    2021-01-05 02:49

    If the problem is having to write the options every time when running maven, you can use a feature available since version 3.3.1 that allows you to set command line options in your project (or parent project of your module). Read @Brice's answer: https://stackoverflow.com/a/48583079

    So with this feature in mind, you can achieve a similar result by setting up a new settings.xml with the pointing to the location you desire and use maven.config in your project to make maven use the new settings.xml, which by the way can be anywhere you want.

提交回复
热议问题