Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

repo1.maven.org ip address keeps on changing

We are setting up server for maven builds. Our corporate servers are behind the firewall and do not allow internet access. For maven build I asked my IT team to allow access to repo1.maven.org. IT team allow access based on the IP address and Port. Recently I noticed that ip address of repo1.maven.org keeps on changing. Few days back it was 93.184.215.223 but today it has changed to 68.232.45.223. We have been not able to download the dependencies due to dynamic change in the IP address. I can not ask my IT team to keep on changing ip address in the firewall. Is there a pool of IP addresses reserved for maven central repository from which they are picked? What should I do?

like image 938
always Avatar asked Nov 02 '22 20:11

always


1 Answers

I am sure this question is more for the Maven Central guys, but I wonder if you can really rely on a pool of IPs even if it exists. I am sure that the infrastructure will be very dynamic as it serves the libraries to the whole world!

  1. I found this IP range for Maven Central when searching for the same. This may change very quickly without any notice, or could even be already outdated.

  2. You could also try a mirror of central which maybe served through a single IP and use it. Again no guarantees that the IP will never change.

  3. Alternatively, you could setup a Maven Repository proxy locally and host it in some sort of a DMZ. Your network guys can either allow all machines from DMZ, or this specific machine (using IP) to access everything outgoing HTTP, which will in-turn allow it to access Maven Central. All your developers will use internal repository as a mirror. This approach will also save your network bandwidth as over time, there will be lesser requests going out to central because of libraries being cached locally.

I recon (3) is the more correct solution although I know its not straight forward.

like image 78
Kalpak Gadre Avatar answered Dec 10 '22 22:12

Kalpak Gadre