Uploaded image for project: 'Forge'
  1. Forge
  2. FORGE-1136

Forge fails to resolve dependencies across multiple password protected Maven repositories located on the same host

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • 3.x Future
    • 1.4.0.Final
    • Build Tools - Maven
    • None

      This is related to FORGE-1134.

      When attempting to resolve dependencies from multiple repositories present on the same host, Forge (actually Maven and Aether) fails to resolve certain dependencies.

      The following is an example:

      [no project] vineet $ forge install-plugin arquillian
      Connecting to remote repository [https://raw.github.com/forge/plugin-repository/master/repository.yaml]... connected!
      ***INFO*** Preparing to install plugin: arquillian
      ***INFO*** Checking out plugin source files to [/tmp/forgetemp448150160827402029] via 'git'
      ***INFO*** Switching to branch/tag [refs/heads/1.0.6.Final]
      ***WARNING*** Failed to read artifact descriptor for org.jboss.forge:forge-shell-api:jar:1.0.6.Final
      Cause : Could not transfer artifact org.jboss.weld:weld-core-bom:pom:1.1.2.Final from/to nexus-local-repo (http://localhost:8081/nexus/content/groups/public/): Access denied to: http://localhost:8081/nexus/content/groups/public/org/jboss/weld/weld-core-bom/1.1.2.Final/weld-core-bom-1.1.2.Final.pom
      ***WARNING*** Failed to read artifact descriptor for org.jboss.forge:forge-shell:jar:1.0.6.Final
      Cause : Could not transfer artifact org.jboss.weld:weld-core-bom:pom:1.1.2.Final from/to nexus-local-repo (http://localhost:8081/nexus/content/groups/public/): Access denied to: http://localhost:8081/nexus/content/groups/public/org/jboss/weld/weld-core-bom/1.1.2.Final/weld-core-bom-1.1.2.Final.pom
      ***WARNING*** Failed to read artifact descriptor for org.jboss.forge:forge-maven-api:jar:1.0.6.Final
      Cause : Could not transfer artifact org.jboss.weld:weld-core-bom:pom:1.1.2.Final from/to nexus-local-repo (http://localhost:8081/nexus/content/groups/public/): Access denied to: http://localhost:8081/nexus/content/groups/public/org/jboss/weld/weld-core-bom/1.1.2.Final/weld-core-bom-1.1.2.Final.pom
      ***WARNING*** Failed to read artifact descriptor for org.jboss.forge:forge-test-harness:jar:1.0.6.Final
      Cause : Could not transfer artifact org.jboss.weld:weld-core-bom:pom:1.1.2.Final from/to nexus-local-repo (http://localhost:8081/nexus/content/groups/public/): Access denied to: http://localhost:8081/nexus/content/groups/public/org/jboss/weld/weld-core-bom/1.1.2.Final/weld-core-bom-1.1.2.Final.pom
      ***WARNING*** Failed to read artifact descriptor for org.jboss.forge:forge-javaee-api:jar:1.0.6.Final
      Cause : Could not transfer artifact org.jboss.weld:weld-core-bom:pom:1.1.2.Final from/to nexus-local-repo (http://localhost:8081/nexus/content/groups/public/): Access denied to: http://localhost:8081/nexus/content/groups/public/org/jboss/weld/weld-core-bom/1.1.2.Final/weld-core-bom-1.1.2.Final.pom
       ? The project does not appear to be a Forge Plugin Project, install anyway? [y/N] 
      ***INFO*** Cleaning up temp workspace [/tmp/forgetemp448150160827402029]
      Wrote /home/vineet/.forge/httpsrawgithubcomforgepluginrepositorymasterrepositoryyaml.yaml
      Deleted /tmp/forgetemp448150160827402029
      ***ERROR*** Exception encountered: Installation aborted (type "set VERBOSE true" to enable stack traces)
      [no project] vineet $ 
      

      In this case, some of the dependencies (present in M2 central) were resolved successfully, while others (present in the public repo group) were not. The underlying cause was that the resolved dependencies were present in a repository or repository group via a valid username+password combination. The unresolved dependencies were also present in a repository or repository group protected by a username+password combination. Although valid credentials were provided by Forge to Maven/Aether for the second repository, this was not used by Maven/Aether.

      The underlying reason is that the JVM caches the credentials used by the Maven LightweightHTTPWagon implementation since the credentials are supplied via a java.net.Authenticator instance. This forces only one set of credentials to be used at runtime; the second set of credentials will be ignored.

              Unassigned Unassigned
              vineet.reynolds_jira Vineet Reynolds (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: