Achim,Thanks.

I'm trying to use mvn, as it does seem the best option. If I can get it to do
what I want though.
What I'm trying to work out is how to ensure that I get exactly the bundle
that's just been published, and nothing gets cached.

I'm publishing SNAPSHOT builds to our artifactory repository.
With the default configuration, I don't get the latest snapshot. So I:

install the feature
Update the code.
Rebuild.
Publish
uninstall, then reinstall the feature.

I get the same bundle again.
Now I don't know anything about maven works, but there seems to be an "update
policy" that by default is "daily". The implication of this is that if I ran
this cycle over two days I might get what I want.

The PAX URL code seems to have a "globalUpdatePolicy" configuration. I set that
to "always", and now I get a complaint from aether about not being able to
resolve the artifact:

Could not find artifact
simple-osgi:simle.osgi.command:jar:1.0.0-20160921.072458-1 in
artifactory-snapshot(repository URL)
        at
shaded.org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:444)[7:org.ops4j.pax.url.mvn:2.4.7]
        at
shaded.org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:246)[7:org.ops4j.pax.url.mvn:2.4.7]
        at
shaded.org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:223)[7:org.ops4j.pax.url.mvn:2.4.7]
        at
shaded.org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveArtifact(DefaultRepositorySystem.java:294)[7:org.ops4j.pax.url.mvn:2.4.7]
        at
org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:650)[7:org.ops4j.pax.url.mvn:2.4.7]
        at
org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:598)[7:org.ops4j.pax.url.mvn:2.4.7]
        at
org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:576)[7:org.ops4j.pax.url.mvn:2.4.7]
        at
org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:550)[7:org.ops4j.pax.url.mvn:2.4.7]
        at
org.apache.karaf.features.internal.download.impl.MavenDownloadTask.download(MavenDownloadTask.java:34)[8:org.apache.karaf.features.core:4.0.6]



The one in the artifactory is now 073344 instead.

So I don't understand what's going on here. Setting "globalUpdatePolicy" seems
to have said "ignore the cached artefacts and go get them again from the
remote", but what it doesn't seem to have said is "check for the latest SNAPSHOT
version", so it's still trying to download the version that it worked out last
time. 


As I say, my knowledge of Maven is minimal at best.
There must be a way of doing this though isn't there? I mean, convince it
somehow to just install whatever is latest on out artefactory repository? I get
the caching thing when you're dealing with release versions, but in this
environment, snapshots ought to not be cached, and attempting to get version
"1.0.0-SNAPSHOT" ought to just go and figure out what the latest version is and
download it (you can cache once you've resolved the SNAPSHOT into its actual
unique version, but not before).

Any ideas?

Thanks.

Reply via email to