Closed marc-personeni closed 7 months ago
Update I managed to connect to my artifactory using the "Coursier Repositories" field instead of "Custom repositories" now all the repo1.maven.org dependencies are coming in.
Continuation of the problem though, some dependencies seem to be sourced from a snapshot repo on oss-sonatype.org. Same problem but other repo url.
Thank, which dependencies are failing for you? Ideally, we should only use maven central for non snapshot releases.
By "Coursier Repositories" do you mean coursier mirrors
field?
Hi Tomasz,
Yes "coursier mirrors" is what I meant. This is what I get in vscode output tab for metals (at the end after all maven dependencies are retrieved)
It Seems like
Resolution error: Error downloading org.scalameta:metals_2.13:1.2.0 not found: /MY_HOME_PATH/.ivy2/local/org.scalameta/metals_2.13/1.2.0/ivys/ivy.xml unauthorized: https://**USER_AND_TOKEN**@**MY_ARTIFACTORY_SERVER**:443/artifactory/mavencentral-remote/org/scalameta/metals_2.13/1.2.0/metals_2.13-1.2.0.pom (Artifactory Realm) download error: Caught java.net.UnknownHostException (dl.bintray.com) while downloading https://dl.bintray.com/scalacenter/releases/org/scalameta/metals_2.13/1.2.0/metals_2.13-1.2.0.pom download error: Caught java.net.UnknownHostException (oss.sonatype.org) while downloading https://oss.sonatype.org/content/repositories/public/org/scalameta/metals_2.13/1.2.0/metals_2.13-1.2.0.pom download error: Caught java.net.UnknownHostException (oss.sonatype.org) while downloading https://oss.sonatype.org/content/repositories/snapshots/org/scalameta/metals_2.13/1.2.0/metals_2.13-1.2.0.pom Downloading Metals failed with the following: Process exited with code 1 Error, couldn't show release notes for Metals 1.2.0 Error: getaddrinfo ENOTFOUND api.github.com
Looks like we haven't found the needed jars in the artifactory:
Resolution error: Error downloading org.scalameta:metals_2.13:1.2.0
not found: /MY_HOME_PATH/.ivy2/local/org.scalameta/metals_2.13/1.2.0/ivys/ivy.xml
unauthorized: https://USER_AND_TOKEN@MY_ARTIFACTORY_SERVER:443/artifactory/mavencentral-remote/org/scalameta/metals_2.13/1.2.0/metals_2.13-1.2.0.pom (Artifactory Realm)
The rest are fallback, where we also look, but they are not available.
Any idea why it wouldn't be available there?
Oh that's odd! 1.2.0 is found on Maven Central website, but not on repo.maven.apache.org (What my Artifactory remote points at) I also checked on https://repo1.maven.org (the offical url listed by sonatype), it is not there either. I thought all these were mirrors.
I just checked the maven-metadata.xml above. It reports an update on the 12 of December 2023, relating to 1.2.0 but the 1.2.0 is not present.
Also I don't know if that helps but just in case... I just installed metals 1.2.0 on a Mac (instead of Linux) with vscode 1.85.1 (instead of 1.85.2) and it installed OK all from repo1.maven.org (no fallback repos used).
I think the problem here is the metals dependency is not available on that repo. Not sure if we can do anything about it. There is a wider issue where an air gapped machine is also discussed, so I think it might be worth concentrating the discussion there.
On startup of vscode the metals extension outputs this and nothing happens.
The url of the maven repo is public and not authorised in our air-gapped environment. Is there a parameter to use our artifactory remote instead of repo1.maven.org?
To Reproduce Steps to reproduce the behavior:
Expected behavior
I was hoping to be able to create a New Scala Project from the metals extension as set is not allowed in our environment (the expectation is that everything should be maven driven)
Screenshots
Installation:
Additional context The maven builds work well with our Artifactory "maven remote" and our settings.xml. The proxy team will not white list repo1.maven.org. Instead we have to use our "maven remote" in Artifactory.
Ideally I would find a setting to customise the maven repo url. I tried the "Custom repositories" but it still bumps on searching in "repo1.maven.org"
Search terms