mavensdkman

mvn dependency:tree hangs trying to read repository


$ mvn --version 

Apache Maven 3.8.4 (9b656c72d54e5bacbed989b64718c159fe39b537)

Maven home: /home/redacted/.sdkman/candidates/maven/current

Java version: 17.0.1, vendor: Azul Systems, Inc., runtime: /home/redacted/.sdkman/candidates/java/17.0.1.fx-zulu

Default locale: en_US, platform encoding: UTF-8

OS name: "linux", version: "5.4.0-91-generic", arch: "amd64", family: "unix"

Running the following command never finishes and it appears to be hung.

mvn -X dependency:tree -Dverbose

The last lines of the debug log report:

[DEBUG] Using transporter WagonTransporter with priority -1.0 for http://repository.tesla.io:8081/nexus/content/repositories/snapshots/

[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for http://repository.tesla.io:8081/nexus/content/repositories/snapshots/

I'm curious why running a dependency tree command is causing maven to try to hit the tesla.io repository on port 8081.

Is there some way to tell dependency:tree to skip this repository (or to configure some timeout and skip all repositories that are unreachable within some specified timeout limit)?

How can I trace the reason why dependency:tree is trying to read from the tesla repository?


Solution

  • As mentioned in the comment above by SteveGreenslade, and per the maven-dependency-plugin documentation:

    verbose:

    Deprecated. in 2.5

    Whether to include omitted nodes in the serialized dependency tree.

    Removing the -D verbose flag after upgrading the plugin above version 2.5 fixed the problem for me.