Unable to resolve SNAPSHOT artifacts from local maven repo

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Unable to resolve SNAPSHOT artifacts from local maven repo

brettcave
I have a problem where karaf (2.2.4) is unable to locate SNAPSHOT versions of artifacts.

When initially setting it up, I added a  org.ops4j.pax.url.mvn.settings parameter to etc/org.ops4j.pax.url.mvn.cfg, and removed all org.ops4j.pax.url.mvn.repositories entries. The settings.xml refers to a local artifactory repository, which initially had a working configuration for /libs-releases repository, but a misconfigured /libs-snapshots repo.

After testing on a test host, karaf was able to resolve and install osgi services from mvn:<group>/<artifact>/<version>-SNAPSHOT without specifying a "settings.xml", but having one in {user.home}/.m2/settings.xml. So i removed the settings entry from the configuration file, and updated the configuration in {user.home}/.m2/settings.xml to match. However, the karaf on the original host still won't resolve -SNAPSHOT artifacts:
     java.lang.RuntimeException: URL [mvn:com.mycompany.group/aeon-osgi/1.0-SNAPSHOT] could not be resolved.

Are the maven settings stored somewhere in a cache that karaf will not resolve snapshots? Settings.xml and the ops4j.pax.url.mvn.cfg files are pretty much identical on both hosts
Reply | Threaded
Open this post in threaded view
|

Re: Unable to resolve SNAPSHOT artifacts from local maven repo

brettcave
Thanks to jbonofre for assisting with this

The problem was that there is apparently a bug with using authenticated repositories. The settings.xml had URLs with <server> configuration for username and password. By removing the settings.xml from the host and configuring etc/org.ops4j.pax.url.mvn.config with:
org.ops4j.pax.url.mvn.repositories= \
    http://user:pass@artifactory.local/artifactory/repo@snapshots

The resolution of artifacts worked.