ops4j / org.ops4j.pax.url

Custom URL stream handlers for OSGi
http://team.ops4j.org/wiki/display/paxurl
Other
25 stars 57 forks source link

Support for "no snapshot updates" flag #411

Open splatch opened 2 years ago

splatch commented 2 years ago

This issue is related to both Aaether and PAX-URL. Currently configuration handling rely on maven settings which can specify repositories and basic offline option. However maven resolver, when used at runtime, can also accept additional options such as no-snapshot-updates (nsu) and force-snapshot-updates (U). These two are relevant from build performance but also reliability as they allow to confirm if maven build is consistent with local repository. From my experience so far pax-url does not have such options resulting in snapshot checks after every midnight. This trouble is easily observable with build containing few snapshots which gets executed after midnight with -o -nsu flags. Maven does not attempt to update snapshot metadadata, but when Karaf feature verification starts the resolver start to spin requests and in the end waste a bunch of time just to refresh filesystem contents with remote metadata. I believe above options are relevant to resolver sessions which can be changing depending on the call context. The resolver sessions are much easier to manage with Maven which has non-continuous execution nature, I guess it is harder for server runtimes.

grgrzybek commented 2 years ago

When using pax-url-aether programmatically, we can set (in Karaf - org.ops4j.pax.url.mvn.globalUpdatePolicy in org.ops4j.pax.url.mvn PID), however I agree there's no automatic configuration of this property by karaf-maven-plugin. Also, I remember that sometimes (always?) there's a conflict between org.ops4j.pax.url.mvn.globalUpdatePolicy and update/snapshotsUpdate set in repository URI.

Let me have a look after log4j Armageddon is over.