Feature repo add in KARAF Error Resolving Artifact : Could not read from local repo

906 Views Asked by At
Error executing command: Error resolving artifact 
com.sample:features:xml:features:4.1.4-SNAPSHOT: 
\[Could not find artifact com.sample:features:xml:features:4.1.4-SNAPSHOT in default 
local (file:/C:{/Users}.m2/repository/), 
Could not find artifact com.sample:features:xml:features:4.1.4-SNAPSHOT in apache 
(https://repository.apache.org/content/groups/snapshots-group/), 
Could not find artifact com.sample:features:xml:features:4.1.4-SNAPSHOT
in ops4j.sonatype.snapshots.deploy 
(https://oss.sonatype.org/content/repositories/ops4j-snapshots/)\] : 
com.sample:features:xml:features:4.1.4-SNAPSHOT.

I could not resolve this error after uncommenting local repository in org.ops4j.pax.url.mvn and add my local .m2 path

Thanks in advance for your suggestions.

1

There are 1 best solutions below

1
Pasi Österman On

You might have to reset your Apache karaf instance to fresh state.

  1. Stop Karaf
  2. Delete data folder from Karaf installation folder.
  3. Start Karaf
  4. Re-Install the features and bundles you need.

Alternatively you can try removing any features, feature-repositories and bundles that have been installed from there before removing the maven repository.

It's generally bad idea to remove/replace maven repositories from Apache Karaf from where user(s) might have already added new feature repositories, installed features and bundles.

Once tried to replace offline repository I had made with a new one which was missing some older artifacts. This lead to bunch of issues like inability to uninstall some of the older features.