Open s-kocher opened 1 year ago
Thanks for taking the time to provide that context from an older issue comment! As you've found we don't have support yet, but we'll track support in this issue.
Are you able to bypass the proxy locally for dependencies also hosted at Maven Central, such that you can still run recipes? Since the error is on spring-boot-starter-actuator
. Or is this blocking you from running any recipe at all?
I shrink the error log but many pom's dependencies failed to be downloaded.
Many Spring dependencies are KO and some non spring too :
[ERROR] <!--~~(org.springframework.boot:spring-boot-starter-actuator:2.7.8 failed. Unable to download POM. Tried repositories:
[ERROR] <!--~~(org.springframework.boot:spring-boot-starter-web:2.7.8 failed. Unable to download POM. Tried repositories:
[ERROR] <!--~~(org.springframework.boot:spring-boot-starter-aop:2.7.8 failed. Unable to download POM. Tried repositories:
[ERROR] <!--~~(org.springframework.boot:spring-boot-starter-data-jdbc:2.7.8 failed. Unable to download POM. Tried repositories:
[ERROR] <!--~~(org.springframework.boot:spring-boot-starter-data-jpa:2.7.8 failed. Unable to download POM. Tried repositories:
[ERROR] <!--~~(io.netty:netty-tcnative-boringssl-static:2.0.51.Final failed. Unable to download POM. Tried repositories:
[ERROR] <!--~~(net.bytebuddy:byte-buddy:1.12.22 failed. Unable to download POM. Tried repositories:
[ERROR] <!--~~(org.springframework.boot:spring-boot-autoconfigure:2.7.8 failed. Unable to download POM. Tried repositories:
[ERROR] <!--~~(org.springframework.boot:spring-boot-starter-security:2.7.8 failed. Unable to download POM. Tried repositories:
[ERROR] <!--~~(org.springframework.boot:spring-boot:2.7.8 failed. Unable to download POM. Tried repositories:
[ERROR] <!--~~(org.springframework.boot:spring-boot-starter:2.7.8 failed. Unable to download POM. Tried repositories:
[ERROR] <!--~~(org.springframework.boot:spring-boot-test:2.7.8 failed. Unable to download POM. Tried repositories:
[ERROR] <!--~~(org.springframework.boot:spring-boot-starter-web:2.7.8 failed. Unable to download POM. Tried repositories:
[ERROR] <!--~~(org.springframework.boot:spring-boot-starter-webflux:2.7.8 failed. Unable to download POM. Tried repositories:
Sadly I have corporate internal dependencies too, they will not be retrieved through Maven Central.
But I don't understand why OpenRewrite Maven plugin did not use the pom.xml already available in local repository ?
We need to check with Maven Central (or another reachable repository) to resolve our dependency version selectors. That's how we're able to upgrade you to the latest version within a range without needing to publish a new release each time Spring, JUnit, Mockito, ... release a new version.
In your case your settings.xml
configuration is tripping you up because you've set mycompany-repo
to be a mirror of *
, rather than only used for internal dependencies. I think if you adjust your mirror settings you might be able to run recipes still, depending on what your network allows.
I tested with that :
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<proxies>
<proxy>
<id>optional</id>
<active>true</active>
<protocol>http</protocol>
<host>proxy.corporate.com</host>
<port>8080</port>
<username>login</username>
<password>{maven_ciphered_password=}</password>
</proxy>
</proxies>
<!-- Remove mirror of central -->
<servers>
<server>
<id>company-group</id>
<username>read-only-login</username>
<password>PASSWORD</password>
</server>
</servers>
<profiles>
<profile>
<id>my-company</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>company-group</id>
<name>My Company repository</name>
<url>https://my.aws.company.com/nexus/repository/mycompany-repo</url>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
</repositories>
</profile>
</profiles>
</settings>
But now, error moves on maven central host's resolution :
[ERROR] <!--~~(org.springframework.boot:spring-boot-starter-web:2.7.8 failed. Unable to download POM. Tried repositories:
[ERROR] https://repo.maven.apache.org/maven2: java.net.UnknownHostException: repo.maven.apache.org)~~>--><dependency>
I guess it's normal if maven proxy is not used.
That indeed looks like a limitation on your network; guess you really do need proxy support for anything to work then. :/
yes that how it works, I guess, in almost all big companies : internet can only be reached through a proxy, often requiring authentication (and often with a lot of complications like NTLM authentication, rarely supported / well implemented in many softwares able to use an internet proxy)
Understandable; we'll track any progress towards proxy support here, although it's competing for attention with other issues, and only happens on restrictive corporate networks using the OSS plugins to run OpenRewrite.
For our corporate customers it's not an issue as the Moderne.io platform runs the recipes on separate workers that are configured differently to cope with such network limitations. I understand that might not yet be an option for you, but thought to provide that context such that you know there is an alternative, which also influences the priority on this ticket. If you have a strong need for this feature, and the platform is not an option, then we're open to contributions to see this resolved more quickly.
Note that -DskipMavenParsing=true
is an option, depending on what recipes you're running. Worked in my case
I recreate an issue for the use of proxy settings in maven settins as mentionned here : https://github.com/openrewrite/rewrite-maven-plugin/issues/449#issuecomment-1344858423
I'm using a company repository mirror hosted on AWS, so proxy is needed to reach it :
settings.xml
When executing this :
org.openrewrite.maven:rewrite-maven-plugin:4.43.0:run
I get this error
I tried to add the JVM argument
-Dorg.openrewrite.test.readMavenSettingsFromDisk=true
without success