0

I want to build a project without referring to my local Maven repo at all, but on the other hand I don't want it to be pruned, as other projects on my disk use it.

How can I disable local repo for some particular project?

Ideally, I'd like to create new repo in target directory and then automatically clean it after build.

Question maven: Is it possible to override location of local repository via the use of command line option or env variable? explains only how to change location of local repo for some particular build or in settings. I'm interested in permanent solution in POM.

Community
  • 1
  • 1
Michal Kordas
  • 10,475
  • 7
  • 58
  • 103
  • What do you mean "disable local repo"? Where would Maven get the dependencies? – Tunaki Feb 04 '16 at 13:42
  • 1
    Possible duplicate of [maven: Is it possible to override location of local repository via the use of command line option or env variable?](http://stackoverflow.com/questions/9123004/maven-is-it-possible-to-override-location-of-local-repository-via-the-use-of-co), by setting the location to a location like `/tmp` you can effectifly have a one shot or local-less build for the project. – Ferrybig Feb 04 '16 at 13:43
  • @Tunaki please see my edit – Michal Kordas Feb 04 '16 at 13:45
  • Okay, then see the linked question yes. Just override the `maven.repo.local` property to point to the target folder then. – Tunaki Feb 04 '16 at 13:46
  • @Tunaki thanks. Can I also specify `maven.repo.local` in POM instead of command line or settings? – Michal Kordas Feb 04 '16 at 13:49
  • Not sure, never tried that. I don't see why it wouldn't work yes. – Tunaki Feb 04 '16 at 13:51

0 Answers0