I am running into a similar issue with karaf 2.4.3 where my localrepositories
are not being used, even though they are specified as local and default
repos in org.ops4.pax.url.mvn.cfg file:
org.ops4j.pax.url.mvn.localRepository=../***@id=local-repository
..
...
org.ops4j.pax.url.mvn.defaultRepositories=file:../***@snapshots@id=defaut-repository,file:${karaf.home}/${karaf.default.repository}@***@id=karaf.${karaf.default.repository}
The error seen in karaf.log is:
INFO: locking
2016-01-12 02:32:46,303 | WARN | Event Dispatcher | AetherBasedResolver
| mvn.internal.AetherBasedResolver 583 | 3 -
org.ops4j.pax.logging.pax-logging-api - 1.8.3 | | Error resolving
artifactcom.ca.im:data-mgmt.provision:xml:features:2.7.0-RELEASE-137:Could
not find artifact
com.ca.im:data-mgmt.provision:xml:features:2.7.0-RELEASE-137 in central
(http://repo1.maven.org/maven2/)
shaded.org.eclipse.aether.resolution.ArtifactResolutionException: Could not
find artifact com.ca.im:data-mgmt.provision:xml:features:2.7.0-RELEASE-137
in central (http://repo1.maven.org/maven2/)
at
shaded.org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:444)
at
shaded.org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:246)
I have tried disabling the aether resolver based on the comments in the
file, and initially that looked like it worked. But, when i set up a script
to restart karaf and look for the error and tested overnight, I could
reproduce the problem with karaf-2.4.3 greater than 50 % of the time.
I enabled some DEBUG / TRACE logging by adding the following line to
etc/org.ops4j.pax.logging.cfg:
log4j.logger.org.ops4j.pax.url.mvn.internal.config.MavenConfigurationImpl=TRACE
Whenever the problem is reproduced, the following TRACE statements confirm
that the default repositories are being used to resolve the feature:
/2016-01-12 19:16:57,682 | TRACE | Event Dispatcher | MavenConfigurationImpl
| al.config.MavenConfigurationImpl 233 | 3 -
org.ops4j.pax.logging.pax-logging-api - 1.8.3 | | Using repositories [[]]
2016-01-12 19:16:57,684 | TRACE | Event Dispatcher | MavenConfigurationImpl
| al.config.MavenConfigurationImpl 318 | 3 -
org.ops4j.pax.logging.pax-logging-api - 1.8.3 | | Using repositories
[[http://repo1.maven.org/maven2/,releases=true,snapshots=false]]
2016-01-12 19:16:57,889 | WARN | Event Dispatcher | AetherBasedResolver
| mvn.internal.AetherBasedResolver 583 | 3 -
org.ops4j.pax.logging.pax-logging-api - 1.8.3 | | Error resolving
artifactcom.ca.im:data-mgmt.provision:xml:features:2.7.0-RELEASE-137:Could
not transfer artifact
com.ca.im:data-mgmt.provision:xml:features:2.7.0-RELEASE-137 from/to central
(http://repo1.maven.org/maven2/): Connection pool shut down
shaded.org.eclipse.aether.resolution.ArtifactResolutionException: Could not
transfer artifact
com.ca.im:data-mgmt.provision:xml:features:2.7.0-RELEASE-137 from/to central
(http://repo1.maven.org/maven2/): Connection pool shut down
at
shaded.org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:444)
at
shaded.org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:246)
...
...
2016-01-12 19:16:57,947 | TRACE | Event Dispatcher | MavenConfigurationImpl
| al.config.MavenConfigurationImpl 233 | 3 -
org.ops4j.pax.logging.pax-logging-api - 1.8.3 | | Using repositories
[[file:../.maven_repository/,releases=true,snapshots=true,
file:/opt/IMDataCollector/apache-karaf-2.4.3/system/,releases=true,snapshots=true]]
2016-01-12 19:16:57,948 | TRACE | Event Dispatcher | MavenConfigurationImpl
| al.config.MavenConfigurationImpl 318 | 3 -
org.ops4j.pax.logging.pax-logging-api - 1.8.3 | | Using repositories [[]]/
And when this works correctly, we never attempt to resolve any feature with
repo1.maven.org.
*2016-01-12 19:13:15,693 | TRACE | Event Dispatcher | MavenConfigurationImpl
| al.config.MavenConfigurationImpl 233 | 3 -
org.ops4j.pax.logging.pax-logging-api - 1.8.3 | | Using repositories
[[file:../.maven_repository/,releases=true,snapshots=true,
file:/opt/IMDataCollector/apache-karaf-2.4.3/system/,releases=true,snapshots=true]]
2016-01-12 19:13:15,694 | TRACE | Event Dispatcher | MavenConfigurationImpl
| al.config.MavenConfigurationImpl 318 | 3 -
org.ops4j.pax.logging.pax-logging-api - 1.8.3 | | Using repositories [[]]*
I have even tried specifying my local folder in the repositories section,
but even that did not work.
org.ops4j.pax.url.mvn.repositories=file:../***@snapshots@id=defaut-repository
It seems to me like once the maven repositories are updated, the
featuresBoot list should be re-processed to avoid such race conditions.
Is this a known issue in karaf? Is the maven.org repo default coming from
karaf or from pax.url.mvn ? How can I get past this race condition ?
--
View this message in context: http://karaf.922171.n3.nabble.com/Add-additional-local-maven-repository-how-tp4028299p4044822.html
Sent from the Karaf - User mailing list archive at Nabble.com.