I have a make file that calls ant and maven build files. I’ve had some trouble setting the proxy settings for maven. because there was no settings.xml file that I could find for this make file. So I created on in the {user.hom}/.m2/ directory where it usually looks for one. This did solve the problem, however when I ran sudo make it did not find this file and started having “connection refused” when it tried to download from remote repositories.
Is there a way to set the Maven proxy settings from within the make file so that I do not have to manually create the settings.xml. Maybe within the pom file or some other way.
It seems like it isn’t fully installed but relying on external references for anything that it needs. I have never installed maven or ant and I cannot find the m2_home directory. This make file should be able to run on systems that do not have maven.
When using sudo, the script is executed as user “root” by default. So the proxy-setup should be in the homedir of root. But i think, its not a good idea to run make with root-privileges.
According to the Maven-Proxy-Example and the Maven-Pom-Reference, there is no proxy config in Pom.
This Question seems to comfirm this. Maybe the
java.net.useSystemProxiesidea can do what you want.I’m not sure if this markup only used by the eclipse plugin or generally by maven itself.