librelist archives

« back to archive

Change repository location

Change repository location

From:
John Mastro
Date:
2013-09-20 @ 23:07
I use Windows at work and while, I set HOME manually, Leiningen and/or
Maven (I'm not sure where the responsibility for repository management
begins and ends) is placing my local repository in my Windows home folder.
This is inconvenient, as that folder is on a different computer (our Active
Directory server) and I have a space limit there. If at all possible I'd
like to move it to my local machine. (In short, it's currently at
\\theserver\users\jbm\.m2 and I want to change it to c:\home\jbm\.m2).

I'm on Leiningen 2.3.2, Java 1.7.0_40. I use Cygwin but I've been trying
everything both via Cygwin and with Windows's normal cmd.exe.

I've tried two different approaches based on what I've found by searching
around, neither of which has worked. First, I put the following in
settings.xml, placed it in \\theserver\users\jbm\.m2\ (where the repository
is being created):

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                  http://maven.apache.org/xsd/settings-1.0.0.xsd">
   <localRepository>c:\home\jbm\.m2\repository</localRepository>
 </settings>

I tried serveral formats for the localRepository path:
- c:\home\jbm\.m2\repository
- c:\\home\\jbm\\.m2\\repository
- /home/jbm/.m2/repository
- /home/jbm/.m2/repository

None of those were successful, regardless of whether I invoked Leiningen
from Cygwin's bash or cmd.exe.

Next I tried placing the following in my ~/.lein/profiles.clj:

{:user {:repositories {"local" {:url "file://home/jbm/.m2/"
                                :releases {:checksum :ignore}}}}}

But that didn't work either (I tried a similarly wide range of
representations for the path there too). Leiningen does, however, emit a
warning about using the :repositories key in a :user profile so I can tell
that it's being picked up.

Does anyone know what I'm doing wrong here?

Thanks,

John

Re: Change repository location

From:
John Mastro
Date:
2013-09-21 @ 05:47
I think I figured this out. The answer seems to be using a :local-repo key
under the :user profile in ~/.lein/profiles.clj.

I knew that :local-repo could be used to set the location for a per-project
repo but missed that it could also set the location for the per-user repo.

Please correct me if I'm wrong about this; otherwise, sorry for the noise.

Thanks

- John


On Fri, Sep 20, 2013 at 4:07 PM, John Mastro <john.b.mastro@gmail.com>wrote:

> I use Windows at work and while, I set HOME manually, Leiningen and/or
> Maven (I'm not sure where the responsibility for repository management
> begins and ends) is placing my local repository in my Windows home folder.
> This is inconvenient, as that folder is on a different computer (our Active
> Directory server) and I have a space limit there. If at all possible I'd
> like to move it to my local machine. (In short, it's currently at
> \\theserver\users\jbm\.m2 and I want to change it to c:\home\jbm\.m2).
>
> I'm on Leiningen 2.3.2, Java 1.7.0_40. I use Cygwin but I've been trying
> everything both via Cygwin and with Windows's normal cmd.exe.
>
> I've tried two different approaches based on what I've found by searching
> around, neither of which has worked. First, I put the following in
> settings.xml, placed it in \\theserver\users\jbm\.m2\ (where the repository
> is being created):
>
> <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
>   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>   xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
>                   http://maven.apache.org/xsd/settings-1.0.0.xsd">
>    <localRepository>c:\home\jbm\.m2\repository</localRepository>
>  </settings>
>
> I tried serveral formats for the localRepository path:
> - c:\home\jbm\.m2\repository
> - c:\\home\\jbm\\.m2\\repository
> - /home/jbm/.m2/repository
> - /home/jbm/.m2/repository
>
> None of those were successful, regardless of whether I invoked Leiningen
> from Cygwin's bash or cmd.exe.
>
> Next I tried placing the following in my ~/.lein/profiles.clj:
>
> {:user {:repositories {"local" {:url "file://home/jbm/.m2/"
>                                 :releases {:checksum :ignore}}}}}
>
> But that didn't work either (I tried a similarly wide range of
> representations for the path there too). Leiningen does, however, emit a
> warning about using the :repositories key in a :user profile so I can tell
> that it's being picked up.
>
> Does anyone know what I'm doing wrong here?
>
> Thanks,
>
> John
>