Kie Scanner is not working in offline mode in BxMS 6.1
Issue
The KieScanner is not working in offline mode. When we try to start our application using KieScanner, the artifact resolution fails with an exception
Unable to resolve artifact: org.kie.example:project1:pom:1.0.0-SNAPSHOT
org.eclipse.aether.resolution.ArtifactResolutionException: Cannot access central (http://repo1.maven.org/maven2/) in offline mode and the artifact org.kie.example:project1:pom:1.0.0-SNAPSHOT has not been downloaded from it before.
We are using the following code for KieScanner:
ReleaseId releaseId = kieServices.newReleaseId( "org.kie.example", "project1", "1.0.0-SNAPSHOT" );
KieContainer kContainer = kieServices.newKieContainer( releaseId );
KieScanner kScanner = kieServices.newKieScanner( kContainer );
with a settings.xml referenced by the -Dkie.maven.settings.custom=/path/to/settings.xml
system property, which forces the usage of a local repository:
<settings>
<localRepository>/home/admin/.m2/repository</localRepository>
<offline>true</offline>
</settings>
We have also verified that the artifact is available in the local repository:
$ cd /home/admin/.m2/repository
$ tree
└── org
└── kie
└── example
└── project1
└── 1.0.0-SNAPSHOT
├── project1-1.0.0-SNAPSHOT.jar
├── project1-1.0.0-SNAPSHOT.pom
└── remote.repositories
Why is maven trying to download the artifact, although the settings indicate offline mode, and the file already being located in the local filesystem?
Environment
- Red Hat JBoss BPM Suite
- 6.1.0
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.