Skip to content
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

PDE integration: resolving of maven dependency doesn't use configured proxy (+ can't force update refresh) #1754

Closed
SVNKoch opened this issue May 13, 2024 · 4 comments

Comments

@SVNKoch
Copy link

SVNKoch commented May 13, 2024

In eclipse I have configured a proxy:
grafik

These settings are however not regarded when fetching a maven dependency in the target definition:
grafik

Example uses:

<dependency>
    <groupId>com.fasterxml.jackson.core</groupId>
    <artifactId>jackson-core</artifactId>
    <version>2.17.1</version>
</dependency>

and results in:

Could not transfer artifact com.fasterxml.jackson.core:jackson-core:jar:2.17.1 from/to central (https://repo.maven.apache.org/maven2): Connect to repo.maven.apache.org:443 [repo.maven.apache.org/151.101.0.215, repo.maven.apache.org/151.101.64.215, repo.maven.apache.org/151.101.128.215, repo.maven.apache.org/151.101.192.215] failed: Connection refused: no further information





Also:
when retrying (even without proxy, so that the adresses are indeed reachable), I get:

com.fasterxml.jackson.core:jackson-core:jar:2.17.1 failed to transfer from https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced. Original error: [...]

(which might be its own issue: Update / Refresh button don't force an update. Couldn't find a way to force it using the UI)

CC @laeubi with PR #21 (and thanks for this great integration!)

@laeubi
Copy link
Member

laeubi commented May 13, 2024

You most probably need to configure proxies in maven:
https://maven.apache.org/guides/mini/guide-proxies.html

@SVNKoch
Copy link
Author

SVNKoch commented May 13, 2024

thanks, I think this is the issue.

I added the proxy to the .m2/settings.xml file.

However now I get the follwong error instead:

Could not transfer artifact com.fasterxml.jackson.core:jackson-core:jar:2.3.0 from/to central (https://repo.maven.apache.org/maven2): PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

I made sure / tried:

  • maven uses my installed java 17 installation
  • in eclipse the chose JRE is the java 17 installation
  • in eclipse maven configured to use my locally installed maven
  • wen to "https://repo.maven.apache.org/maven2" in my browser, downloaded the certificate (company CA) and imported it into java keystore using keytool -cacerts -importcert -file "C:\company-cert.crt" -alias "company-cert" -storepass changeit
  • later also tried adding the issuing CA and proxy certs (downloaded them from chain in firefox, then imported as above)
  • restarted Eclipse

Maybe you have an idea why this is?

@laeubi
Copy link
Member

laeubi commented May 14, 2024

This is always a bit messy to debug, but keep in mind that you need to check the JRE that is used to run Eclipse here you can't configure it anywhere inside Eclipse.

@SVNKoch
Copy link
Author

SVNKoch commented May 15, 2024

Wow that was it! 🥳 Thank you so much @laeubi!

For reference:
in the eclipse.ini file in your installation you can configure which JRE is used to launch eclipse. In my case it was:

-vm
plugins/org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_17.0.10.v20240120-1143/jre/bin

If changed to

-vm
C:/Program Files/Eclipse Adoptium/jdk-17.0.10.7-hotspot/bin

(where my certificates were added) it works.

Alternatively you can also install the certificates (both root CA and issuing) into that keystore

keytool -import -keystore "plugins/org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_17.0.10.v20240120-1143/jre/lib/security/cacerts" -trustcacerts -storepass changeit -noprompt -alias "company-cert" -file "C:\company-cert.crt"
keytool -import -keystore "plugins/org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_17.0.10.v20240120-1143/jre/lib/security/cacerts" -trustcacerts -storepass changeit -noprompt -alias "issuing-company-cert" -file "C:\issuing-company-cert.crt"

@SVNKoch SVNKoch closed this as completed May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants