I’ve been using Maven for projects, and these projects regularly connect to external, intra-net based repositories. I want to do a few one-off’s at times, and I don’t want them to connect to my intranet–just strictly my local repository.
In my settings.xml file, I’ve added a second profile for these projects, so that I can specify that profile during during builds, but I don’t know how to tell it I only want to search a local repository at /path/to/my/local/repo.
Is a secondary profile the right approach here, or should I do something with running Maven in offline (-o) mode and adding a new mirror? I’ve seen some approaches similar to this, but not sure how to set a path instead of a url in the mirror declaration.
Thanks to @andrew_logvinov for pointing out that it’s relatively easy to do this by just specifying a “
-o” to yourmvnrequest. You don’t need any local mirror setups or profiles in your settings.xml file.If you need to install a file into your local repository, you’d do: