javamavenopenrewrite

rewrite-maven-plugin - Resolving Poms takes a long time trying to resolve blocked repositories


When I am trying to use the rewrite-maven-plugin in my project (see https://docs.openrewrite.org/reference/rewrite-maven-plugin)

When I run the plugin I get a big hang while it tries to resolve a bunch of repositories that are in my list but I don't even have access to over firewall.

So it sits there and times out for several minutes on those before running.

[INFO] --- rewrite-maven-plugin:5.42.0:run (default-cli) @ nicksClient ---
[INFO] Using active recipe(s) [org.openrewrite.java.spring.boot2.SpringBoot2JUnit4to5Migration, org.openrewrite.java.testing.cleanup.TestsShouldNotBePublic]
[INFO] Using active styles(s) []
[INFO] Validating active recipes...
[INFO] Project [nicksClient] Resolving Poms...
[WARNING] Failed to access maven repository http://some.nexushost/content/repositories/releases/ due to: Connect timed out
[WARNING] Failed to access maven repository http://some.nexushost/content/repositories/thirdparty/ due to: Connect timed out
...

Can I specify repositories to exclude?


Solution

  • Perhaps it helps you to configure a <timeout> per inaccessible server, as per https://maven.apache.org/guides/mini/guide-http-settings.html#connection-timeouts

    Support for parsing <timeout> was added in https://github.com/openrewrite/rewrite/pull/4302

    Do note that we do not support per-HTTP method <connectionTimeout>(!).