Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1172220

Summary: KIE-CI adds local Maven repository to the list of remote repositories
Product: [Retired] JBoss BRMS Platform 6 Reporter: Marek Winkler <mwinkler>
Component: BREAssignee: Mario Fusco <mfusco>
Status: CLOSED NOTABUG QA Contact: Marek Winkler <mwinkler>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.1.0CC: gdesmet
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-12-09 17:27:17 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Marek Winkler 2014-12-09 16:12:16 UTC
Description of problem:

During verification of BZ 1097148, I came across an unexpected error message:

[main] WARN org.kie.scanner.MavenRepository - Unable to resolve artifact: org.jboss.qa.brms:kieCiExtArtifact:pom:1.0.0-SNAPSHOT
org.eclipse.aether.resolution.ArtifactResolutionException: Cannot access local (file:/home/mwinkler/work/repositories/samples/kie-ci-offline-mode/repo/) in offline mode and the artifact org.jboss.qa.brms:kieCiExtArtifact:pom:1.0.0-SNAPSHOT has not been downloaded from it before.

The exception itself is expected, but I do not understand why Aether attempts to download artifacts from local repository:

  "Cannot access local (file:/home/mwinkler/work/repositories/samples/kie-ci-offline-mode/repo/)"

When I configured Maven to use offline mode, I always get an error mentioning proper remote repositories, not the local one. I have looked at the implementation and found that KIE-CI indeed adds the local repository into the list of remote repositories [1]. I do not know what problems this could cause but I would like to ask Mario and Geoffrey to double check if the implemented logic is alright - just in case it would bite us later.

Thanks!

[1] https://github.com/droolsjbpm/drools/blob/master/kie-ci/src/main/java/org/kie/scanner/Aether.java#L79

Version-Release number of selected component (if applicable):

BRMS 6.1.0 ER2

How reproducible:

Please follow the procedure described at https://bugzilla.redhat.com/show_bug.cgi?id=1097148#c2 - then see the exception message.

Actual results:

The exception message states that it is accessing the local repo:

  Cannot access local (file:/home/mwinkler/work/repositories/samples/kie-ci-offline-mode/repo/) in offline mode and the artifact org.jboss.qa.brms:kieCiExtArtifact:pom:1.0.0-SNAPSHOT has not been downloaded from it before.

Expected results:

The exception message does not mention downloading from local repo, e.g.:

   Cannot access red-hat-enterprise-repository (https://maven.repository.redhat.com/techpreview/all/) in offline mode and the artifact X.Y.Z has not been downloaded from it before.

Comment 1 Mario Fusco 2014-12-09 17:27:17 UTC
Marek,

I double checked this and believe that the name RemoteRepository is just a bit misleading in maven/aether API.

When you make a request to maven you have to set, among other things, the repositories you want to use to fullfil that request. See an example here: https://github.com/droolsjbpm/drools/blob/master/kie-ci/src/main/java/org/kie/scanner/MavenRepository.java#L170

All the maven's request objects have that addRepository() method that accepts a RemoteRepository instance and there's no way to explicitly define a LocalRepository. However if I don't add the local repo among the list of RemoteRepositories to be used by maven requests, the biggest part of kie-ci tests fail, so I assume it is necessary to specify it in the requests and I cannot find another way to do this.

I'm closing this ticket for now, but if you think I am overlooking something or have any better idea to make this work, please reopen it and let me know.

Comment 2 Marek Winkler 2014-12-10 08:10:04 UTC
Mario,

thanks for clarification, it makes sense, just the error message looks weird to me (and I was worried if it represented a potential problem). We can keep this ticket closed - if I find out something more, I will reopen it.