Using a Windows mapped drive as an artifact/component repository

1.4k Views Asked by At

I would like to avoid using a full-fledged component repository such as Nexus/Artifactory as remote repository and use a mapped Windows drive instead with such:

\\drive\path\to\repository\

I am not sure how to proceed. Do I need the Wagon plugin for that?

Ideally, I would need to leave the POMs alone and modify the settings.xml only. Is this possible?

2

There are 2 best solutions below

2
On

Just add the path to your settings.xml to use a remote file system as your local repository instead of under your .m2 directory:

<localRepository>\\drive\path\to\repository\</localRepository>

Of course, this will slow down your builds considerably, and if others are also sharing it, then you will find builds failing due to conflicts when multiple users access the build artifacts simultaneously.

Are you sure it's worth it when it would probably take less than an hour to set up a proper proxy/repository?

0
On

Yes you can add mirrors to your settings file and it accepts other protocols than http. It is recommended to use file://. I tried this and it worked

<settings>
    <mirrors>
        <mirror>
            <id>mac</id>
            <url>file:////server/folder/etc/</url>
            <mirrorOf>*</mirrorOf>
        </mirror> 
    </mirrors>
</settings>