At work, we use Maven to do builds for the project I work on. The Infrastructure IT people also have helpfully configured it so that every user account has a home directory conveniently located on a file server. Since we use Windows (Windows 2000 to be precise...), that home directory is a UNC path of the form \\server\share\folder.
This, it turns out, is rather bad for Maven.
See, Maven has a settings.xml file that allows you to configure it. Things like the local repository location, proxy settings, remote repositories, etc. get configured in that file. So it's kind of important. Maven looks for that file at <home directory>/.m2/settings.xml. And there in lies the problem with having <home directory> be a UNC path: Maven or Java or something just breaks, and that file isn't found/read.
Now, apparently if you put the file in C:\server\share\folder\.m2, Maven will find it. Sometimes. I didn't see consistent behaviour when trying that approach, and ended up abandoning it last year. Part of the problem may have been that different Maven things (mvn, Eclipse plugin) handled the exceptional situation differently, so builds might work from inside Eclipse and then fail on the command line.
So I began looking for a different approach, and took a look at the root cause of the problem. Attempting to get the Infrastructure people to change their policies and affect thousands of accounts as doomed to a slow failure, forcing me to try and find a workaround that was specific to my computer.
And at last! The grand unveiling! It's really quite simple in principle: if the home directory path is causing a problem, lets just make Maven see a different path. Doing so isn't quite that simple though.
Here are the steps:
Okay, that should be it for just Maven. In theory these steps could be applied to other Java apps that have problems with finding settings in home directories. I've been lucky enough not to run into any of those apps though.
Now playing: Basia Bulat – Oh, My Darling – 07 In The Night
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.