You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by JT <ka...@avionicengineers.com> on 2016/01/15 22:41:45 UTC
Configuring repositories
Hi,
I just wanted to clarify how to set-up repositories in
org.ops4j.pax.url.mvn.cfg
I have 3 machines. Machine A runs an instance of Karaf. Machine B
contains my Apache Archiva instance from which I pull bundles. I develop
the bundles on machine C.
I develop snapshot bundles on machine C and I push them to Archiva on
machine B. I then install them in my Karaf instance (machine A) using
the 'install mvn' command and have configured org.ops4j.pax.url.mvn.cfg
to include the URL of the Apache Archiva of machine B. If it is the
first time I have installed a snapshot bundle in the Karaf instance it
retrieves it as expected from Archiva on machine B. However if I update
the snapshot and push to archive, when I update the Karaf instance it
does not refer to Archiva but uses the snapshot held in the local .m2
repository.
If I set org.ops4j.pax.url.mvn.defaultLocalRepoAsRemote=true then it
appears to work as I require i.e. the latest snapshot is retrieved from
Archiva on machine B. Is this the correct way to achieve what I want,
i.e. always force Karaf to look at my remote repositories especially for
snapshots and where does the local repository appear in the order of
remotes if the above config. is set?
Thanks
jt
Re: Configuring repositories
Posted by JT <ka...@avionicengineers.com>.
Hi JB and Ed,
I thought I had org.ops4j.pax.url.mvn.cfg set correctly however it turns
out I still cannot pull the latest snapshot from my Archiva. I will try
Ed's suggestion
Thanks
On 16/01/16 13:21, Ed Welch wrote:
> JT,
>
> I also always set
>
> org.ops4j.pax.url.mvn.globalUpdatePolicy=always
>
> In org.ops4j.pax.url.mvn.cfg when I'm working with snapshots.
>
> Just like how local maven has an update policy of 24hours for pulling snapshots from a remote repo, so does Karaf.
>
> This way, every time I run bundle:update, it checks my remote repo for new snapshots.
>
> Take a look at https://ops4j1.jira.com/wiki/display/paxurl/Mvn+Protocol for more info.
>
> Regards,
> Ed
>
> On Sat, 16 Jan 2016 06:23:42 +0100, Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:
>
>> Hi JT,
>>
>> it depends what you want.
>>
>> By default, Karaf fist looks into the local Maven repository ($HOME/.m2)
>> and goes to remote repositories if the artifact is not found locally:
>> it's the regular "Maven" behaviour.
>>
>> If you want to check first on remote repository, then the local
>> repository has to be consider as a remote one.
>>
>> Regards
>> JB
>>
>> On 01/15/2016 10:41 PM, JT wrote:
>>> Hi,
>>>
>>> I just wanted to clarify how to set-up repositories in
>>> org.ops4j.pax.url.mvn.cfg
>>>
>>> I have 3 machines. Machine A runs an instance of Karaf. Machine B
>>> contains my Apache Archiva instance from which I pull bundles. I develop
>>> the bundles on machine C.
>>>
>>> I develop snapshot bundles on machine C and I push them to Archiva on
>>> machine B. I then install them in my Karaf instance (machine A) using
>>> the 'install mvn' command and have configured org.ops4j.pax.url.mvn.cfg
>>> to include the URL of the Apache Archiva of machine B. If it is the
>>> first time I have installed a snapshot bundle in the Karaf instance it
>>> retrieves it as expected from Archiva on machine B. However if I update
>>> the snapshot and push to archive, when I update the Karaf instance it
>>> does not refer to Archiva but uses the snapshot held in the local .m2
>>> repository.
>>>
>>> If I set org.ops4j.pax.url.mvn.defaultLocalRepoAsRemote=true then it
>>> appears to work as I require i.e. the latest snapshot is retrieved from
>>> Archiva on machine B. Is this the correct way to achieve what I want,
>>> i.e. always force Karaf to look at my remote repositories especially for
>>> snapshots and where does the local repository appear in the order of
>>> remotes if the above config. is set?
>>>
>>> Thanks
>>>
>>> jt
>>>
>>>
>> --
>> Jean-Baptiste Onofré
>> jbonofre@apache.org
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
>
>
Re: Configuring repositories
Posted by JT <ka...@avionicengineers.com>.
Hi,
I'm reposting on this thread as I still cannot get Karaf to pull in the latest bundle from my remote repository. Karaf always appears to look in $HOME/.m2 first so consequently I have to delete the local bundle first to force Karaf to look at the remote. This is my org.ops4j.pax.url.mvn.cfg file:
#
# Default this to false. It's just weird to use undocumented repos
#
org.ops4j.pax.url.mvn.useFallbackRepositories=false
#
# Uncomment if you don't wanna use the proxy settings
# from the Maven conf/settings.xml file
#
# org.ops4j.pax.url.mvn.proxySupport=false
#
# Comma separated list of repositories scanned when resolving an artifact.
# Those repositories will be checked before iterating through the
# below list of repositories and even before the local repository
# A repository url can be appended with zero or more of the following flags:
# @snapshots : the repository contains snaphots
# @noreleases : the repository does not contain any released artifacts
#
# The following property value will add the system folder as a repo.
#
org.ops4j.pax.url.mvn.defaultRepositories=\
<remote_snapshot_repo_and_IP_and_id_removed>@snapshots@noreleases, \
file:${karaf.home}/${karaf.default.repository}@id=system.repository@snapshots, \
file:${karaf.data}/kar@id=kar.repository@multi@snapshots, \
file:${karaf.base}/${karaf.default.repository}@id=child.system.repository@snapshots, \
<remote_repo_and_IP_and_id_removed>, \
<remote_snapshot_repo_and_IP_and_id_removed>@snapshots@noreleases
# Use the default local repo (e.g.~/.m2/repository) as a "remote" repo
org.ops4j.pax.url.mvn.defaultLocalRepoAsRemote=true
#
# Comma separated list of repositories scanned when resolving an artifact.
# The default list includes the following repositories:
# http://repo1.maven.org/maven2@id=central
# http://repository.springsource.com/maven/bundles/release@id=spring.ebr
# 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
# To add repositories to the default ones, prepend '+' to the list of repositories
# to add.
# A repository url can be appended with zero or more of the following flags:
# @snapshots : the repository contains snapshots
# @noreleases : the repository does not contain any released artifacts
# @id=repository.id : the id for the repository, just like in the settings.xml this is optional but recommended
#
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, \
<remote_snapshot_repo_and_IP_and_id_removed>@snapshots@noreleases, \
<remote_repo_and_IP_and_id_removed>
org.ops4j.pax.url.mvn.globalUpdatePolicy=always
Any help appreciated
JT
On 16/01/16 13:21, Ed Welch wrote:
> JT,
>
> I also always set
>
> org.ops4j.pax.url.mvn.globalUpdatePolicy=always
>
> In org.ops4j.pax.url.mvn.cfg when I'm working with snapshots.
>
> Just like how local maven has an update policy of 24hours for pulling snapshots from a remote repo, so does Karaf.
>
> This way, every time I run bundle:update, it checks my remote repo for new snapshots.
>
> Take a look at https://ops4j1.jira.com/wiki/display/paxurl/Mvn+Protocol for more info.
>
> Regards,
> Ed
>
> On Sat, 16 Jan 2016 06:23:42 +0100, Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:
>
>> Hi JT,
>>
>> it depends what you want.
>>
>> By default, Karaf fist looks into the local Maven repository ($HOME/.m2)
>> and goes to remote repositories if the artifact is not found locally:
>> it's the regular "Maven" behaviour.
>>
>> If you want to check first on remote repository, then the local
>> repository has to be consider as a remote one.
>>
>> Regards
>> JB
>>
>> On 01/15/2016 10:41 PM, JT wrote:
>>> Hi,
>>>
>>> I just wanted to clarify how to set-up repositories in
>>> org.ops4j.pax.url.mvn.cfg
>>>
>>> I have 3 machines. Machine A runs an instance of Karaf. Machine B
>>> contains my Apache Archiva instance from which I pull bundles. I develop
>>> the bundles on machine C.
>>>
>>> I develop snapshot bundles on machine C and I push them to Archiva on
>>> machine B. I then install them in my Karaf instance (machine A) using
>>> the 'install mvn' command and have configured org.ops4j.pax.url.mvn.cfg
>>> to include the URL of the Apache Archiva of machine B. If it is the
>>> first time I have installed a snapshot bundle in the Karaf instance it
>>> retrieves it as expected from Archiva on machine B. However if I update
>>> the snapshot and push to archive, when I update the Karaf instance it
>>> does not refer to Archiva but uses the snapshot held in the local .m2
>>> repository.
>>>
>>> If I set org.ops4j.pax.url.mvn.defaultLocalRepoAsRemote=true then it
>>> appears to work as I require i.e. the latest snapshot is retrieved from
>>> Archiva on machine B. Is this the correct way to achieve what I want,
>>> i.e. always force Karaf to look at my remote repositories especially for
>>> snapshots and where does the local repository appear in the order of
>>> remotes if the above config. is set?
>>>
>>> Thanks
>>>
>>> jt
>>>
>>>
>>
>> --
>> Jean-Baptiste Onofré
>> jbonofre@apache.org
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
>
>
>
Re: Configuring repositories
Posted by Ed Welch <ed...@edjusted.com>.
JT,
I also always set
org.ops4j.pax.url.mvn.globalUpdatePolicy=always
In org.ops4j.pax.url.mvn.cfg when I'm working with snapshots.
Just like how local maven has an update policy of 24hours for pulling snapshots from a remote repo, so does Karaf.
This way, every time I run bundle:update, it checks my remote repo for new snapshots.
Take a look at https://ops4j1.jira.com/wiki/display/paxurl/Mvn+Protocol for more info.
Regards,
Ed
On Sat, 16 Jan 2016 06:23:42 +0100, Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:
> Hi JT,
>
> it depends what you want.
>
> By default, Karaf fist looks into the local Maven repository ($HOME/.m2)
> and goes to remote repositories if the artifact is not found locally:
> it's the regular "Maven" behaviour.
>
> If you want to check first on remote repository, then the local
> repository has to be consider as a remote one.
>
> Regards
> JB
>
> On 01/15/2016 10:41 PM, JT wrote:
> > Hi,
> >
> > I just wanted to clarify how to set-up repositories in
> > org.ops4j.pax.url.mvn.cfg
> >
> > I have 3 machines. Machine A runs an instance of Karaf. Machine B
> > contains my Apache Archiva instance from which I pull bundles. I develop
> > the bundles on machine C.
> >
> > I develop snapshot bundles on machine C and I push them to Archiva on
> > machine B. I then install them in my Karaf instance (machine A) using
> > the 'install mvn' command and have configured org.ops4j.pax.url.mvn.cfg
> > to include the URL of the Apache Archiva of machine B. If it is the
> > first time I have installed a snapshot bundle in the Karaf instance it
> > retrieves it as expected from Archiva on machine B. However if I update
> > the snapshot and push to archive, when I update the Karaf instance it
> > does not refer to Archiva but uses the snapshot held in the local .m2
> > repository.
> >
> > If I set org.ops4j.pax.url.mvn.defaultLocalRepoAsRemote=true then it
> > appears to work as I require i.e. the latest snapshot is retrieved from
> > Archiva on machine B. Is this the correct way to achieve what I want,
> > i.e. always force Karaf to look at my remote repositories especially for
> > snapshots and where does the local repository appear in the order of
> > remotes if the above config. is set?
> >
> > Thanks
> >
> > jt
> >
> >
>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
Re: Configuring repositories
Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi JT,
it depends what you want.
By default, Karaf fist looks into the local Maven repository ($HOME/.m2)
and goes to remote repositories if the artifact is not found locally:
it's the regular "Maven" behaviour.
If you want to check first on remote repository, then the local
repository has to be consider as a remote one.
Regards
JB
On 01/15/2016 10:41 PM, JT wrote:
> Hi,
>
> I just wanted to clarify how to set-up repositories in
> org.ops4j.pax.url.mvn.cfg
>
> I have 3 machines. Machine A runs an instance of Karaf. Machine B
> contains my Apache Archiva instance from which I pull bundles. I develop
> the bundles on machine C.
>
> I develop snapshot bundles on machine C and I push them to Archiva on
> machine B. I then install them in my Karaf instance (machine A) using
> the 'install mvn' command and have configured org.ops4j.pax.url.mvn.cfg
> to include the URL of the Apache Archiva of machine B. If it is the
> first time I have installed a snapshot bundle in the Karaf instance it
> retrieves it as expected from Archiva on machine B. However if I update
> the snapshot and push to archive, when I update the Karaf instance it
> does not refer to Archiva but uses the snapshot held in the local .m2
> repository.
>
> If I set org.ops4j.pax.url.mvn.defaultLocalRepoAsRemote=true then it
> appears to work as I require i.e. the latest snapshot is retrieved from
> Archiva on machine B. Is this the correct way to achieve what I want,
> i.e. always force Karaf to look at my remote repositories especially for
> snapshots and where does the local repository appear in the order of
> remotes if the above config. is set?
>
> Thanks
>
> jt
>
>
--
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com