How to access BRMS maven repository?

Solution Verified - Updated -

Issue

  • I get the following WARNING when I press "Build&Deploy" in business-central
[WARNING] Failure to transfer com.example:my-facts:1.0.0-SNAPSHOT/maven-metadata.xml from https://localhost:8080/business-central/maven2/ was cached in the local repository, resolution will not be reattempted until the update interval of guvnor-m2-repo has elapsed or updates are forced. Original error: Could not transfer metadata com.example:my-facts:1.0.0-SNAPSHOT/maven-metadata.xml from/to guvnor-m2-repo (https://localhost:8080/business-central/maven2/): Unauthorized (401)
  • I want to access a remote BRMS rule project from one of my local java maven project.I have added below tags in pom.xml of local java project
<repository>
  <id>guvnor-m2-repo</id>
  <name>Guvnor M2 Repo</name>
  <url>http://10.10.10.10:8080/business-central/maven2/</url>
</repository>
...

<!-- rules project in Guvnor is required -->
<dependency>
  <groupId>org.kie.example</groupId>
  <artifactId>project1</artifactId>
  <version>1.0.0</version>
</dependency>

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

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

When we try to build local maven project it fails with below exception:

[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.
    ...
 . . . 
  • How to import jars from remote maven repository of BRMS 6 server to local maven project ?

Environment

  • Red Hat JBoss BRMS (BRMS)
    • 6.0.0
    • 6.4.0
  • Red Hat JBoss BPM Suite (BRMS)
    • 6.0.0
    • 6.4.0

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content