Bug 1059584 - Cannot access to remote business-central maven repository
Summary: Cannot access to remote business-central maven repository
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: JBoss BRMS Platform 6
Classification: Retired
Component: Business Central
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: ER1
: 6.0.1
Assignee: manstis
QA Contact: Jiri Locker
URL:
Whiteboard:
: 1074986 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-01-30 08:49 UTC by Toshiya Kobayashi
Modified: 2018-12-04 17:14 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2014-02-27 19:03:56 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1074986 0 high CLOSED Remote access to the intern remote JBoss BPMS 6 Maven repos does not work 2021-02-22 00:41:40 UTC
Red Hat Issue Tracker DROOLS-436 0 Major Resolved Cannot access to remote kie maven repository - Access denied 2019-07-04 01:27:30 UTC

Internal Links: 1074986

Description Toshiya Kobayashi 2014-01-30 08:49:37 UTC
Description of problem:

Reproduced in 6.0.0.Beta and 6.0.0.CR2.

- Start BRMS binding a specific IP (e.g. $ standalone.sh -b 10.10.10.10)
- Run maven in a remote machine with the pom.xml like this

<repository>
  <id>guvnor-m2-repo</id>
  <name>Guvnor M2 Repo</name>
  <url>http://10.10.10.10:8080/business-central/maven2/</url>
</repository>

Also having username/password in ~/.m2/settings.xml

  <servers>
    <server>
      <id>guvnor-m2-repo</id>
      <username>admin</username>
      <password>password1!</password>
    </server>
  </servers>

- 'mvn clean install' fails with the following message

[ERROR] Failed to execute goal on project TestApp: Could not resolve dependencies for project com.sample:TestApp:jar:1.0.0: Failed to collect dependencies at org.kie.example:project1:jar:1.0.0-SNAPSHOT: Failed to read artifact descriptor for org.kie.example:project1:jar:1.0.0-SNAPSHOT: Could not transfer artifact org.kie.example:project1:pom:1.0.0-SNAPSHOT from/to guvnor-m2-repo (http://10.10.10.10:8080/business-central/maven2/): Not authorized , ReasonPhrase:Unauthorized. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project TestApp: Could not resolve dependencies for project com.sample:TestApp:jar:1.0.0: Failed to collect dependencies at org.kie.example:project1:jar:1.0.0-SNAPSHOT
    at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:220)
    . . . 
Caused by: org.apache.maven.project.DependencyResolutionException: Could not resolve dependencies for project com.sample:TestApp:jar:1.0.0: Failed to collect dependencies at org.kie.example:project1:jar:1.0.0-SNAPSHOT
    at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:167)
    at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:195)
    ... 22 more
Caused by: org.eclipse.aether.collection.DependencyCollectionException: Failed to collect dependencies at org.kie.example:project1:jar:1.0.0-SNAPSHOT
    at org.eclipse.aether.internal.impl.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:292)
    ...
Caused by: org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for org.kie.example:project1:jar:1.0.0-SNAPSHOT
    ...
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not transfer artifact org.kie.example:project1:pom:1.0.0-SNAPSHOT from/to guvnor-m2-repo (http://10.10.10.10:8080/business-central/maven2/): Not authorized , ReasonPhrase:Unauthorized.
    ...

Interestingly, this works without error if BRMS and maven client exist in the same machine (even if BRMS binds a specific IP instead of localhost).

Steps to Reproduce:

See above.

Actual results:

maven fails.

Expected results:

maven successfully build.

Additional info:

You can workaround this by modifying business-central.war/WEB-INF/classes/url_filter.yaml file.
===
filter:
   - pattern: /rest/**
   - pattern: /org.kie.workbench.drools.KIEDroolsWebapp/**

exclude:
   - /*.ico
   - /org.kie.workbench.drools.KIEDroolsWebapp/images/**
   - /org.kie.workbench.drools.KIEDroolsWebapp/css/**
   - /css/**
   - /images/**
   - /maven2/**
===

I filed this BZ for the case where users still want authentication.

Comment 4 Jiri Locker 2014-02-27 19:03:56 UTC
This is not a bug in the product. The workarounds suggested by Michael were verified for 6.0.0.GA and 6.0.1.ER1. To summarize:

It is either needed to turn on pre-emptive authentication for the repository server by

    <server>
      <id>guvnor-m2-repo</id>
      <username>admin</username>
      <password>admin</password>
      <configuration>
        <wagonProvider>httpclient</wagonProvider>
        <httpConfiguration>
          <all>
            <usePreemptive>true</usePreemptive>
          </all>
        </httpConfiguration>
      </configuration>
    </server>

or set Authorization HTTP header with Base64 encoded credentials

    <server>
      <id>guvnor-m2-repo</id>
      <configuration>
        <httpHeaders>
          <property>
            <name>Authorization</name>
            <!-- Base64-encoded "admin:admin" -->
            <value>Basic YWRtaW46YWRtaW4=</value>
          </property>
        </httpHeaders>
      </configuration>
    </server>

This should be documented.

Comment 5 JBoss JIRA Server 2014-03-24 11:37:15 UTC
Mario Fusco <mario.fusco> updated the status of jira DROOLS-436 to Resolved

Comment 6 Jiri Svitak 2014-04-22 11:34:02 UTC
*** Bug 1074986 has been marked as a duplicate of this bug. ***


Note You need to log in before you can comment on or make changes to this bug.