Is there a way to disable the local maven repository?

若如初见. 提交于 2019-12-06 07:44:29

I wouldn't want to point my local repo to the nexus datastore, because then installs would update the repository datastore behind nexus' back.

However you could set up a single "machine" local repo separate to the nexus datastore,
and then for each user change the ~/.m2/repository directory to be a symlink pointing to the "machine" local repo.

At least then you'll only have 2 copies of the repo.

Concurrent installs and downloads, are still likely to clobber one another, but this can be fixed with an annoying redo.

Update:

There is a new solution available.

Installation of the TEAM (Takari Extensions for Apache Maven) extensions, provides a thread-safe local repository and an improved algorithm for multi module builds.

See http://takari.io/book/30-team-maven.html#concurrent-safe-local-repository

I'm not sure if this directly answers your concern, but it looks like what you're doing is correct.

From http://maven.apache.org/settings.html

localRepository: This value is the path of this build system's local repository. The default value is ${user.home}/.m2/repository. This element is especially useful for a main build server allowing all logged-in users to build from a common local repository.

Use the --offline option at command line.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!