Backend Notes JUL 6, 2024 • 02 MIN READ

CAN'T DOWNLOAD
DEPENDENCIES
'MVN CLEAN INSTALL'

“Notes for later: when Maven’s clean install step got stuck because dependencies wouldn’t download.”

Abstract technical background

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

settings.xml JAVA
<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

settings.xml JAVA
<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>

READ BEYOND THE VOID

Technical blueprint background
Backend Notes

Setup New Server

Just notes to myself.

Read Entry
Abstract digital network
Backend Notes

SSH Without Password

Just notes to myself.

Read Entry
Circuit board macro
Backend Notes

N+1 Query Problem

Avoid N+1 query problem...

Read Entry