CAN'T DOWNLOAD
DEPENDENCIES
'MVN CLEAN INSTALL'
“Notes for later: when Maven’s clean install step got stuck because dependencies wouldn’t download.”
Case when 'mvn clean install' on your server got stuct because maven can't download dependencies. It failed bacause server not connected to internet.
How to solve?
Check your connection and config your proxy internet.
telnet ip_proxy proxy_port
if already connected but still refuse download dependencies, check your proxy config in setting xml, /.m2/settings.xml
add proxy config in your /.m2/settings.xml
<proxies>
<proxy>
<id>example-proxy2</id>
<active>true</active>
<protocol>https</protocol>
<host>your_ip_proxy</host>
<port>port_proxy</port>
<username></username>
<password></password>
</proxy>
</proxies>Note this: Proxy enabled (in settings.xml) so dependencies can be downloaded, but it prevents connecting to Sonar.
When this happen, add nonProxy flag to your sonar command
mvn sonar:sonar -Dsonar.projectKey=${SERVICE_GROUP}:${SERVICE_NAME}-${BRANCH} -Dsonar.projectName=${SERVICE_NAME}-${BRANCH} -Dsonar.host.url=${SONAR_URL} -Dsonar.token=${SONAR_TOKEN} -Dhttp.nonProxyHosts=${IP_SONAR}
or in your /.m2/settings.xml
<proxies>
<proxy>
<id>example-proxy2</id>
<active>true</active>
<protocol>https<protocol>
<host>your_ip_proxy</host>
<port>port_proxy</port>
<username></username>
<password></password>
<nonProxyHosts>ip_sonar</nonProxyHosts>
</proxy>
</proxies>