Skip to content

Maven plugin unable to download anything from Artifactory #1089

@pmbruun

Description

@pmbruun

Describe the bug
VS Code extensions Maven is unable to download any artifact (Java or otherwise) from our internal Artifactory server, which uses custom CA certificate and http proxies. This happens regardless of the project type or structure.

Downloading artifacts works fine from command-line and in Eclipse so the problem is specific to VS Code.

Key facts:

  • Command-line Maven works perfectly and downloads from Artifactory without issue. Unfortunately, Maven in VS Code sometimes downloads different versions of artifacts to the .m2 directory than the command-line, so running from command-line does not solve the issue.
  • The JDK used by VS Code is configured with the correct version and correct custom truststore cacerts file.
  • VS Code is started from a terminal with all required proxy and environment variables.
  • There are no errors in the Output panel.
  • Running mvn in VS Code’s integrated terminal works fine.
  • Eclipse is able to download from Artifactory using the configured cacerts
  • Other developers experience the same issue, regardless of JDK version.
  • There is nothing of relevance in settings.json

To Reproduce
Steps to reproduce the behavior:

  1. Clean up the .m2 repository
  2. Ensure that cacerts is correctly linked in the selected Java installation /usr/lib/jvm/java-17-openjdk-17.0.7.0.7-3.el8.x86_64/lib/security
  3. Open code from the command-line
  4. Open a project that requires artifacts - typically a Java project
  5. The build fails because no artifacts are found
  6. Build from command-line or Eclipse
  7. Now all errors pertaining to the artifacts that were successfully dowloaded work in VS Code
  8. Sometimes, VS Code resolves artifact versions differently than command-line or Eclipse, and since these cannot be downloaded, there are still errors

Expected behavior
VS Code fails to download from Artifactory even though the configuration works fine in other environments and when mvn is executed directly from within VS Code terminal window.

Environments (please complete the following information as much as possible):

  • OS: AlmaLinux release 8.8
  • VS Code version: 1.103.0
  • Extension version: Maven for Java v0.44.0
  • Extension version: Language support for Java by Red Hat v1.44.0

Additional information

It may be that there is some simple solution, but in that case there some guidance missing in the outputs. GitHub Copilot was unable to resolve the issue and recommended posting here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions