You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by AndyPhillips404 <an...@fastmail.com> on 2016/08/23 16:51:47 UTC

Snapshots always updating on remote repository

I am working on a docker environment of Karaf, which we use for development
of our software modules.   We are unable to get the bundle:update to update
from a remote location but only the first time (guessing its once a day)
when we boot up the docker container.  It makes development a bit more
challenging.   We are running the development in an isolated docker
environment so the snapshots should be pulled from the local repository.  
Here are the settings of my mvn url (which i have tried to follow everything
i see online).   

Any thoughts?  i've tried everything.   I am using a clean download of maven
3.3.9 and karaf 4.0.5

Pid:            org.ops4j.pax.url.mvn
BundleLocation: mvn:org.ops4j.pax.url/pax-url-aether/2.4.7
Properties:
   felix.fileinstall.filename =
file:/opt/karaf/etc/org.ops4j.pax.url.mvn.cfg
   org.ops4j.pax.url.mvn.defaultLocalRepoAsRemote = false
   org.ops4j.pax.url.mvn.defaultRepositories =
file:/opt/karaf/system@id=system.repository@snapshots,
file:/opt/karaf/data/kar@id=kar.repository@multi@snapshots,
file:/opt/karaf/system@id=child.system.repository@snapshots
   org.ops4j.pax.url.mvn.globalUpdatePolicy = always
   org.ops4j.pax.url.mvn.proxySupport = false
   org.ops4j.pax.url.mvn.repositories =
http://repo1.maven.org/maven2@id=central,
http://repository.springsource.com/maven/bundles/release@id=spring.ebr.release,
http://repository.springsource.com/maven/bundles/external@id=spring.ebr.external,
http://zodiac.springsource.com/maven/bundles/release@id=gemini,
http://repository.apache.org/content/groups/snapshots-group@id=apache@snapshots@noreleases,
https://oss.sonatype.org/content/repositories/snapshots@id=sonatype.snapshots.deploy@snapshots@noreleases,
https://oss.sonatype.org/content/repositories/ops4j-snapshots@id=ops4j.sonatype.snapshots.deploy@snapshots@noreleases,
http://repository.springsource.com/maven/bundles/external@id=spring-ebr-repository@snapshots@noreleases,
http://X:X@data.hdscores.com:8080/nexus/content/repositories/releases@id=hdscores_releases@releasesUpdate=always,
http://X:X@data.hdscores.com:8080/nexus/content/repositories/snapshots@snapshots@id=hdscores_snapshots@snapshotsUpdate=always,
https://awplab.com/nexus/content/repositories/snapshots@id=awplab_snapshots@snapshots@snapshotsUpdate=always,
https://awplab.com/nexus/content/repositories/releases@id=awplab_releases@releasesUpdate=always
   org.ops4j.pax.url.mvn.useFallbackRepositories = false
   service.pid = org.ops4j.pax.url.mvn



--
View this message in context: http://karaf.922171.n3.nabble.com/Snapshots-always-updating-on-remote-repository-tp4047629.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Snapshots always updating on remote repository

Posted by AndyPhillips404 <an...@fastmail.com>.
I think i'm getting closer to the issue.  Two things, i found out that there
appears to be a bug in PAX URL (although seems unrelated) when you set the
org.ops4j.pax.url.mvn.defaultLocalRepoAsRemote to any value, (even if it is
false) the code assume it to be true:

if (m_propertyResolver.get(m_pid +
ServiceConstants.PROPERTY_LOCAL_REPO_AS_REMOTE) != null) {
                MavenRepositoryURL localRepository =
getDefaultLocalRepository();
                if (localRepository != null) {
                    repositoriesProperty.add(localRepository);
                }
            }

That, i am guess, is not intended.   If you set the value to true or false,
it includes the local in the repositories for resolution.  This is in
MavenConfiguraitonImpl.java line 306, which is run once to build the
repository list

If i remove the org.ops4j.pax.url.mvn.defaultLocalRepoAsRemote, it still
doesn't solve the issue.

Further digging, i find out that the problem appears to be in org.eclipse
Aether library.   I still am digging, but i verified that the Aether
resolver does think the wrong snapshot version is the latest.   I am
guessing it has to do with the Cache.   With you change configuration, the
Pax Url Aether library creates a new resolver, which in turns creates a new
session in org.eclipse Aether.   

I'm going to keep digging but thought i would send my progress....





--
View this message in context: http://karaf.922171.n3.nabble.com/Snapshots-not-always-updating-on-remote-repository-tp4047629p4047638.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Snapshots always updating on remote repository

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Thanks for the update.

I gonna take a look in Pax URL as well.

Regards
JB

On 08/23/2016 07:18 PM, AndyPhillips404 wrote:
> Sorry for another email, but i also wanted to add one ODD behavior.   If i do
> the following (even though the property is already set to false):
>
> config:edit org.ops4j.pax.url.mvn
> config:property-set org.ops4j.pax.url.mvn.proxySupport false
> config:update
>
> then i do a:
> bundle:update 52
>
> it works every time.   It also doesn't matter which property i pick.   Maybe
> something with the configuration admin and url-aether?  i was going to start
> digging into code...
>
>
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Snapshots-not-always-updating-on-remote-repository-tp4047629p4047636.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

-- 
Jean-Baptiste Onofr
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Snapshots always updating on remote repository

Posted by AndyPhillips404 <an...@fastmail.com>.
Sorry for another email, but i also wanted to add one ODD behavior.   If i do
the following (even though the property is already set to false):

config:edit org.ops4j.pax.url.mvn
config:property-set org.ops4j.pax.url.mvn.proxySupport false
config:update

then i do a:
bundle:update 52

it works every time.   It also doesn't matter which property i pick.   Maybe
something with the configuration admin and url-aether?  i was going to start
digging into code...





--
View this message in context: http://karaf.922171.n3.nabble.com/Snapshots-not-always-updating-on-remote-repository-tp4047629p4047636.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Snapshots always updating on remote repository

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
OK let me try to reproduce (assuming the Maven metadata are updated).

Regards
JB

On 08/23/2016 07:15 PM, AndyPhillips404 wrote:
> Using the location doesn't seem to make a difference.  It always works once,
> then that's it until i reset (and rebuild) the docker container.
>
> karaf@root()> bundle:update 52
> karaf@root()> bundle:update 52 mvn:com.awplab.core/admin
> karaf@root()> bundle:update 52 mvn:com.awplab.core/admin/1.0.0-SNAPSHOT
>
>
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Snapshots-not-always-updating-on-remote-repository-tp4047629p4047632.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

-- 
Jean-Baptiste Onofr
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Snapshots always updating on remote repository

Posted by AndyPhillips404 <an...@fastmail.com>.
Using the location doesn't seem to make a difference.  It always works once,
then that's it until i reset (and rebuild) the docker container.

karaf@root()> bundle:update 52
karaf@root()> bundle:update 52 mvn:com.awplab.core/admin
karaf@root()> bundle:update 52 mvn:com.awplab.core/admin/1.0.0-SNAPSHOT





--
View this message in context: http://karaf.922171.n3.nabble.com/Snapshots-not-always-updating-on-remote-repository-tp4047629p4047632.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Snapshots always updating on remote repository

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Can you try this way to see if it helps ?

Thanks,
Regards
JB

On 08/23/2016 07:09 PM, AndyPhillips404 wrote:
> No, i do not use the location with the update.
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Snapshots-not-always-updating-on-remote-repository-tp4047629p4047631.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

-- 
Jean-Baptiste Onofr
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Snapshots always updating on remote repository

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
By the way, the bundle location URL is a mvn URL with SNAPSHOT right ?

something like:

mvn:groupId/artifactId/xxx-SNAPSHOT

(you can check using la -u)

Thanks,
Regards
JB

On 08/23/2016 07:09 PM, AndyPhillips404 wrote:
> No, i do not use the location with the update.
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Snapshots-not-always-updating-on-remote-repository-tp4047629p4047631.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

-- 
Jean-Baptiste Onofr
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Snapshots always updating on remote repository

Posted by AndyPhillips404 <an...@fastmail.com>.
No, i do not use the location with the update.   



--
View this message in context: http://karaf.922171.n3.nabble.com/Snapshots-not-always-updating-on-remote-repository-tp4047629p4047631.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Snapshots always updating on remote repository

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Andy,

Do you use bundle:update with the location:

bundle:update 1234 mvn:....

?

Regards
JB

On 08/23/2016 06:51 PM, AndyPhillips404 wrote:
> I am working on a docker environment of Karaf, which we use for development
> of our software modules.   We are unable to get the bundle:update to update
> from a remote location but only the first time (guessing its once a day)
> when we boot up the docker container.  It makes development a bit more
> challenging.   We are running the development in an isolated docker
> environment so the snapshots should be pulled from the local repository.
> Here are the settings of my mvn url (which i have tried to follow everything
> i see online).
>
> Any thoughts?  i've tried everything.   I am using a clean download of maven
> 3.3.9 and karaf 4.0.5
>
> Pid:            org.ops4j.pax.url.mvn
> BundleLocation: mvn:org.ops4j.pax.url/pax-url-aether/2.4.7
> Properties:
>    felix.fileinstall.filename =
> file:/opt/karaf/etc/org.ops4j.pax.url.mvn.cfg
>    org.ops4j.pax.url.mvn.defaultLocalRepoAsRemote = false
>    org.ops4j.pax.url.mvn.defaultRepositories =
> file:/opt/karaf/system@id=system.repository@snapshots,
> file:/opt/karaf/data/kar@id=kar.repository@multi@snapshots,
> file:/opt/karaf/system@id=child.system.repository@snapshots
>    org.ops4j.pax.url.mvn.globalUpdatePolicy = always
>    org.ops4j.pax.url.mvn.proxySupport = false
>    org.ops4j.pax.url.mvn.repositories =
> http://repo1.maven.org/maven2@id=central,
> http://repository.springsource.com/maven/bundles/release@id=spring.ebr.release,
> http://repository.springsource.com/maven/bundles/external@id=spring.ebr.external,
> http://zodiac.springsource.com/maven/bundles/release@id=gemini,
> http://repository.apache.org/content/groups/snapshots-group@id=apache@snapshots@noreleases,
> https://oss.sonatype.org/content/repositories/snapshots@id=sonatype.snapshots.deploy@snapshots@noreleases,
> https://oss.sonatype.org/content/repositories/ops4j-snapshots@id=ops4j.sonatype.snapshots.deploy@snapshots@noreleases,
> http://repository.springsource.com/maven/bundles/external@id=spring-ebr-repository@snapshots@noreleases,
> http://X:X@data.hdscores.com:8080/nexus/content/repositories/releases@id=hdscores_releases@releasesUpdate=always,
> http://X:X@data.hdscores.com:8080/nexus/content/repositories/snapshots@snapshots@id=hdscores_snapshots@snapshotsUpdate=always,
> https://awplab.com/nexus/content/repositories/snapshots@id=awplab_snapshots@snapshots@snapshotsUpdate=always,
> https://awplab.com/nexus/content/repositories/releases@id=awplab_releases@releasesUpdate=always
>    org.ops4j.pax.url.mvn.useFallbackRepositories = false
>    service.pid = org.ops4j.pax.url.mvn
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Snapshots-always-updating-on-remote-repository-tp4047629.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

-- 
Jean-Baptiste Onofr
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com