-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OpenRewrite's Maven resolution does not use the proxy configuration from the settings.xml #543
Comments
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 |
I shrink the error log but many pom's dependencies failed to be downloaded. Many Spring dependencies are KO and some non spring too :
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 |
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 :
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 |
I am now running into this problem. "In restrictive networks" sounds a bit biased because it is actually the norm that artifacts are not loaded from any public sources in CI/CD processes but through internal repository managers. However, in the case of my evaluation, certain repositories are fetched from the internet and only added to the repository manager after successful evaluation. I am somewhat surprised that the OpenRewrite Maven plugin deliberately does not use the Maven mechanisms for artifact verification or, put differently, apparently works without a proxy.
Disabling the parsing of the POM As a workaround, configuring the proxy for the Java VM in the following form (Windows CLI) helps here:
|
I recreate an issue for the use of proxy settings in maven settins as mentionned here : #449 (comment)
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 successThe text was updated successfully, but these errors were encountered: