You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@karaf.apache.org by Jean-Baptiste Onofré <jb...@nanthrax.net> on 2014/09/01 10:14:08 UTC

Re: [INFO] Update default etc/org.ops4j.pax.url.mvn.cfg on Karaf 3.0.x

Hi Matt,

I agree.

Let me explain what I have in mind.

Karaf can work in two modes:
- by default, it should be standalone/atomic. I mean here that it should 
not use any "external folders" like the .m2/repository folder.
It means the following configuration in etc/org.ops4j.pax.url.mvn.cfg file:
  -- org.ops4j.pax.url.mvn.settings=${karaf.etc}/settings.xml
      where the settings.xml contains an "empty" settings.xml like:
         <?xml version="1.0" encoding="UTF-8"?>
         <settings></settings>
  -- 
org.ops4j.pax.url.mvn.localRepository=${karaf.home}/${karaf.default.repository}
    to use the system repo as local by default (and not .m2/repository)
  -- org.ops4j.pax.url.mvn.defaultRepositories=\
       ${karaf.home}/${karaf.default.repository}@id=system@snapshots, \
       ${karaf.data}/kar@id=kar@multi@snapshots
  -- org.ops4j.pax.url.mvn.repositories=\
       http://repo1.maven.org/maven2@id=central, \
 
http://repository.springsource.com/maven/bundle/release@id=spring.ebr.release, 
\
 
http://repository.springsource.com/maven/bundles/external@id=spring.ebr.external, 
\
 
http://repository.apache.org/content/groups/snapshots-group@id=apache@snapshots@noreleases, 
\
 
https://oss.sonatype.org/content/repositories/snapshots@id=sonatype.snapshots.deploy@snapshots@norelease, 
\
 
https://oss.sonatype.org/content/repositories/ops4j-snapshots@id=ops4j.sonatype.snapshots.deploy@snapshots@noreleases

- as an alternative, we document (both in the user guide and using 
comments in etc/org.ops4j.pax.url.mnv.cfg) how to switch in "development 
mode", meaning:
   -- comment the org.ops4j.pax.url.mvn.settings property to use the 
user .m2/settings.xml
   -- comment the org.ops4j.pax.url.mvn.localRepository property to use 
the user .m2/repository

WDYT ?

Regards
JB

On 08/31/2014 10:49 PM, Matt Sicker wrote:
> Basically, the way I see it, in a developer setting, using your
> .m2/repository makes sense as it's likely to have tons of libraries there
> already. On production/staging/testing servers, however, it's far more
> likely to contain things as much as possible. For instance, I may wish to
> run Karaf as a user that has no home directory.
>
>
> On 31 August 2014 15:43, Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:
>
>> Following this thread, I wonder if it doesn't make sense to add the system
>> repo as local repo:
>>
>> org.ops4j.pax.url.mvn.localRepository=file:${karaf.home}/${karaf.default.
>> repository}
>>
>> and override the default m2 settings with an empty one in Karaf:
>>
>> org.ops4j.pax.url.mvn.settings=${karaf.home}/${karaf.default.repository}/
>> settings.xml
>>
>> by default, and document how to switch back to Maven "local user
>> configuration".
>>
>> It would avoid to populate the .m2/repository and force to use the
>> artifacts from the system repo (so very close to what we have in Karaf 2.x).
>>
>> WDYT ?
>>
>> Regards
>> JB
>>
>>
>> On 08/31/2014 10:31 PM, Matt Sicker wrote:
>>
>>> I quite like that change. In my Karaf usage, I've always reconfigured the
>>> .m2/repository directory to be inside KARAF_HOME instead just to isolate
>>> the repositories in the first place. Any sort of change that prefers usage
>>> of artifact repositories embedded in Karaf are a step forward IMO.
>>>
>>>
>>> On 31 August 2014 14:36, Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:
>>>
>>>   Hi all,
>>>>
>>>> FYI, I aligned the etc/org.ops4j.pax.url.mvn.cfg files between master
>>>> (Karaf 4.x) and Karaf 3.0.x.
>>>>
>>>> Basically, the change is to move the system repo and the kar repo as
>>>> default repositories, instead of "regular" repositories.
>>>>
>>>> It allows Karaf to start quicker on a fresh machine, without any
>>>> .m2/repository.
>>>>
>>>> Any objection ?
>>>>
>>>> Regards
>>>> JB
>>>> --
>>>> Jean-Baptiste Onofré
>>>> jbonofre@apache.org
>>>> http://blog.nanthrax.net
>>>> Talend - http://www.talend.com
>>>>
>>>>
>>>
>>>
>>>
>> --
>> Jean-Baptiste Onofré
>> jbonofre@apache.org
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
>>
>
>
>

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

Re: [INFO] Update default etc/org.ops4j.pax.url.mvn.cfg on Karaf 3.0.x

Posted by Matt Sicker <bo...@gmail.com>.
I like the change so far! Also, personally, I don't mind upgrades of things
like Pax, Aries, Felix, BND, etc., as long as they aren't huge releases
(e.g., 2.0 -> 3.0) without a good reason. This is mainly due to bugfixes
and such that have caused much pain in the past! ;)


On 1 September 2014 08:25, Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:

> Working on this improvement, I faced a couple of severe bugs in Pax URL,
> preventing a clean usage of the system repository.
>
> So, I upgraded to Pax URL 2.1.0 on Karaf 3.0.x. I know that we should
> avoid such kind of changes for a minor release, however, I think the Pax
> URL issues are really important and justify the update.
>
> I did:
> - upgrade to Pax URL 2.1.0
> - use of the uber bundles
> - cleanup in the etc/org.ops4j.pax.url.mvn.cfg configuration file
>
> You can see the commit there:
> https://git-wip-us.apache.org/repos/asf?p=karaf.git;a=commitdiff;h=
> 9c6fccd6b376512fa73e92cfad83ed6062ce9d4f
>
> IMHO, the situation is largely better now, as the system repo is use first.
>
> If you see a problem with this change, please let me know, I will revert
> my change.
>
> Thanks,
> Regards
> JB
>
>
> On 09/01/2014 10:14 AM, Jean-Baptiste Onofré wrote:
>
>> Hi Matt,
>>
>> I agree.
>>
>> Let me explain what I have in mind.
>>
>> Karaf can work in two modes:
>> - by default, it should be standalone/atomic. I mean here that it should
>> not use any "external folders" like the .m2/repository folder.
>> It means the following configuration in etc/org.ops4j.pax.url.mvn.cfg
>> file:
>>   -- org.ops4j.pax.url.mvn.settings=${karaf.etc}/settings.xml
>>       where the settings.xml contains an "empty" settings.xml like:
>>          <?xml version="1.0" encoding="UTF-8"?>
>>          <settings></settings>
>>   --
>> org.ops4j.pax.url.mvn.localRepository=${karaf.home}/
>> ${karaf.default.repository}
>>
>>     to use the system repo as local by default (and not .m2/repository)
>>   -- org.ops4j.pax.url.mvn.defaultRepositories=\
>>        ${karaf.home}/${karaf.default.repository}@id=system@snapshots, \
>>        ${karaf.data}/kar@id=kar@multi@snapshots
>>   -- org.ops4j.pax.url.mvn.repositories=\
>>        http://repo1.maven.org/maven2@id=central, \
>>
>> http://repository.springsource.com/maven/bundle/
>> release@id=spring.ebr.release,
>> \
>>
>> http://repository.springsource.com/maven/bundles/external@id=spring.
>> ebr.external,
>> \
>>
>> http://repository.apache.org/content/groups/snapshots-
>> group@id=apache@snapshots@noreleases,
>> \
>>
>> https://oss.sonatype.org/content/repositories/snapshots@id=sonatype.
>> snapshots.deploy@snapshots@norelease,
>> \
>>
>> https://oss.sonatype.org/content/repositories/ops4j-
>> snapshots@id=ops4j.sonatype.snapshots.deploy@snapshots@noreleases
>>
>>
>> - as an alternative, we document (both in the user guide and using
>> comments in etc/org.ops4j.pax.url.mnv.cfg) how to switch in "development
>> mode", meaning:
>>    -- comment the org.ops4j.pax.url.mvn.settings property to use the
>> user .m2/settings.xml
>>    -- comment the org.ops4j.pax.url.mvn.localRepository property to use
>> the user .m2/repository
>>
>> WDYT ?
>>
>> Regards
>> JB
>>
>> On 08/31/2014 10:49 PM, Matt Sicker wrote:
>>
>>> Basically, the way I see it, in a developer setting, using your
>>> .m2/repository makes sense as it's likely to have tons of libraries there
>>> already. On production/staging/testing servers, however, it's far more
>>> likely to contain things as much as possible. For instance, I may wish to
>>> run Karaf as a user that has no home directory.
>>>
>>>
>>> On 31 August 2014 15:43, Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:
>>>
>>>  Following this thread, I wonder if it doesn't make sense to add the
>>>> system
>>>> repo as local repo:
>>>>
>>>> org.ops4j.pax.url.mvn.localRepository=file:${karaf.
>>>> home}/${karaf.default.
>>>>
>>>> repository}
>>>>
>>>> and override the default m2 settings with an empty one in Karaf:
>>>>
>>>> org.ops4j.pax.url.mvn.settings=${karaf.home}/${
>>>> karaf.default.repository}/
>>>>
>>>> settings.xml
>>>>
>>>> by default, and document how to switch back to Maven "local user
>>>> configuration".
>>>>
>>>> It would avoid to populate the .m2/repository and force to use the
>>>> artifacts from the system repo (so very close to what we have in
>>>> Karaf 2.x).
>>>>
>>>> WDYT ?
>>>>
>>>> Regards
>>>> JB
>>>>
>>>>
>>>> On 08/31/2014 10:31 PM, Matt Sicker wrote:
>>>>
>>>>  I quite like that change. In my Karaf usage, I've always
>>>>> reconfigured the
>>>>> .m2/repository directory to be inside KARAF_HOME instead just to
>>>>> isolate
>>>>> the repositories in the first place. Any sort of change that prefers
>>>>> usage
>>>>> of artifact repositories embedded in Karaf are a step forward IMO.
>>>>>
>>>>>
>>>>> On 31 August 2014 14:36, Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:
>>>>>
>>>>>   Hi all,
>>>>>
>>>>>>
>>>>>> FYI, I aligned the etc/org.ops4j.pax.url.mvn.cfg files between master
>>>>>> (Karaf 4.x) and Karaf 3.0.x.
>>>>>>
>>>>>> Basically, the change is to move the system repo and the kar repo as
>>>>>> default repositories, instead of "regular" repositories.
>>>>>>
>>>>>> It allows Karaf to start quicker on a fresh machine, without any
>>>>>> .m2/repository.
>>>>>>
>>>>>> Any objection ?
>>>>>>
>>>>>> Regards
>>>>>> JB
>>>>>> --
>>>>>> Jean-Baptiste Onofré
>>>>>> jbonofre@apache.org
>>>>>> http://blog.nanthrax.net
>>>>>> Talend - http://www.talend.com
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>  --
>>>> Jean-Baptiste Onofré
>>>> jbonofre@apache.org
>>>> http://blog.nanthrax.net
>>>> Talend - http://www.talend.com
>>>>
>>>>
>>>
>>>
>>>
>>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>



-- 
Matt Sicker <bo...@gmail.com>

Re: [INFO] Update default etc/org.ops4j.pax.url.mvn.cfg on Karaf 3.0.x

Posted by Stuart McCulloch <mc...@gmail.com>.
+1 makes sense to me

PS. you might also want to upgrade pax-swissbox-bnd to 1.7.1 to pick up the fix for https://ops4j1.jira.com/browse/PAXSB-75

On 1 Sep 2014, at 14:25, Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:

> Working on this improvement, I faced a couple of severe bugs in Pax URL, preventing a clean usage of the system repository.
> 
> So, I upgraded to Pax URL 2.1.0 on Karaf 3.0.x. I know that we should avoid such kind of changes for a minor release, however, I think the Pax URL issues are really important and justify the update.
> 
> I did:
> - upgrade to Pax URL 2.1.0
> - use of the uber bundles
> - cleanup in the etc/org.ops4j.pax.url.mvn.cfg configuration file
> 
> You can see the commit there:
> https://git-wip-us.apache.org/repos/asf?p=karaf.git;a=commitdiff;h=9c6fccd6b376512fa73e92cfad83ed6062ce9d4f
> 
> IMHO, the situation is largely better now, as the system repo is use first.
> 
> If you see a problem with this change, please let me know, I will revert my change.
> 
> Thanks,
> Regards
> JB
> 
> On 09/01/2014 10:14 AM, Jean-Baptiste Onofré wrote:
>> Hi Matt,
>> 
>> I agree.
>> 
>> Let me explain what I have in mind.
>> 
>> Karaf can work in two modes:
>> - by default, it should be standalone/atomic. I mean here that it should
>> not use any "external folders" like the .m2/repository folder.
>> It means the following configuration in etc/org.ops4j.pax.url.mvn.cfg file:
>>  -- org.ops4j.pax.url.mvn.settings=${karaf.etc}/settings.xml
>>      where the settings.xml contains an "empty" settings.xml like:
>>         <?xml version="1.0" encoding="UTF-8"?>
>>         <settings></settings>
>>  --
>> org.ops4j.pax.url.mvn.localRepository=${karaf.home}/${karaf.default.repository}
>> 
>>    to use the system repo as local by default (and not .m2/repository)
>>  -- org.ops4j.pax.url.mvn.defaultRepositories=\
>>       ${karaf.home}/${karaf.default.repository}@id=system@snapshots, \
>>       ${karaf.data}/kar@id=kar@multi@snapshots
>>  -- org.ops4j.pax.url.mvn.repositories=\
>>       http://repo1.maven.org/maven2@id=central, \
>> 
>> http://repository.springsource.com/maven/bundle/release@id=spring.ebr.release,
>> \
>> 
>> http://repository.springsource.com/maven/bundles/external@id=spring.ebr.external,
>> \
>> 
>> http://repository.apache.org/content/groups/snapshots-group@id=apache@snapshots@noreleases,
>> \
>> 
>> https://oss.sonatype.org/content/repositories/snapshots@id=sonatype.snapshots.deploy@snapshots@norelease,
>> \
>> 
>> https://oss.sonatype.org/content/repositories/ops4j-snapshots@id=ops4j.sonatype.snapshots.deploy@snapshots@noreleases
>> 
>> 
>> - as an alternative, we document (both in the user guide and using
>> comments in etc/org.ops4j.pax.url.mnv.cfg) how to switch in "development
>> mode", meaning:
>>   -- comment the org.ops4j.pax.url.mvn.settings property to use the
>> user .m2/settings.xml
>>   -- comment the org.ops4j.pax.url.mvn.localRepository property to use
>> the user .m2/repository
>> 
>> WDYT ?
>> 
>> Regards
>> JB
>> 
>> On 08/31/2014 10:49 PM, Matt Sicker wrote:
>>> Basically, the way I see it, in a developer setting, using your
>>> .m2/repository makes sense as it's likely to have tons of libraries there
>>> already. On production/staging/testing servers, however, it's far more
>>> likely to contain things as much as possible. For instance, I may wish to
>>> run Karaf as a user that has no home directory.
>>> 
>>> 
>>> On 31 August 2014 15:43, Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:
>>> 
>>>> Following this thread, I wonder if it doesn't make sense to add the
>>>> system
>>>> repo as local repo:
>>>> 
>>>> org.ops4j.pax.url.mvn.localRepository=file:${karaf.home}/${karaf.default.
>>>> 
>>>> repository}
>>>> 
>>>> and override the default m2 settings with an empty one in Karaf:
>>>> 
>>>> org.ops4j.pax.url.mvn.settings=${karaf.home}/${karaf.default.repository}/
>>>> 
>>>> settings.xml
>>>> 
>>>> by default, and document how to switch back to Maven "local user
>>>> configuration".
>>>> 
>>>> It would avoid to populate the .m2/repository and force to use the
>>>> artifacts from the system repo (so very close to what we have in
>>>> Karaf 2.x).
>>>> 
>>>> WDYT ?
>>>> 
>>>> Regards
>>>> JB
>>>> 
>>>> 
>>>> On 08/31/2014 10:31 PM, Matt Sicker wrote:
>>>> 
>>>>> I quite like that change. In my Karaf usage, I've always
>>>>> reconfigured the
>>>>> .m2/repository directory to be inside KARAF_HOME instead just to
>>>>> isolate
>>>>> the repositories in the first place. Any sort of change that prefers
>>>>> usage
>>>>> of artifact repositories embedded in Karaf are a step forward IMO.
>>>>> 
>>>>> 
>>>>> On 31 August 2014 14:36, Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:
>>>>> 
>>>>>  Hi all,
>>>>>> 
>>>>>> FYI, I aligned the etc/org.ops4j.pax.url.mvn.cfg files between master
>>>>>> (Karaf 4.x) and Karaf 3.0.x.
>>>>>> 
>>>>>> Basically, the change is to move the system repo and the kar repo as
>>>>>> default repositories, instead of "regular" repositories.
>>>>>> 
>>>>>> It allows Karaf to start quicker on a fresh machine, without any
>>>>>> .m2/repository.
>>>>>> 
>>>>>> Any objection ?
>>>>>> 
>>>>>> Regards
>>>>>> JB
>>>>>> --
>>>>>> Jean-Baptiste Onofré
>>>>>> jbonofre@apache.org
>>>>>> http://blog.nanthrax.net
>>>>>> Talend - http://www.talend.com
>>>>>> 
>>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>> --
>>>> Jean-Baptiste Onofré
>>>> jbonofre@apache.org
>>>> http://blog.nanthrax.net
>>>> Talend - http://www.talend.com
>>>> 
>>> 
>>> 
>>> 
>> 
> 
> -- 
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com


Re: [INFO] Update default etc/org.ops4j.pax.url.mvn.cfg on Karaf 3.0.x

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Working on this improvement, I faced a couple of severe bugs in Pax URL, 
preventing a clean usage of the system repository.

So, I upgraded to Pax URL 2.1.0 on Karaf 3.0.x. I know that we should 
avoid such kind of changes for a minor release, however, I think the Pax 
URL issues are really important and justify the update.

I did:
- upgrade to Pax URL 2.1.0
- use of the uber bundles
- cleanup in the etc/org.ops4j.pax.url.mvn.cfg configuration file

You can see the commit there:
https://git-wip-us.apache.org/repos/asf?p=karaf.git;a=commitdiff;h=9c6fccd6b376512fa73e92cfad83ed6062ce9d4f

IMHO, the situation is largely better now, as the system repo is use first.

If you see a problem with this change, please let me know, I will revert 
my change.

Thanks,
Regards
JB

On 09/01/2014 10:14 AM, Jean-Baptiste Onofré wrote:
> Hi Matt,
>
> I agree.
>
> Let me explain what I have in mind.
>
> Karaf can work in two modes:
> - by default, it should be standalone/atomic. I mean here that it should
> not use any "external folders" like the .m2/repository folder.
> It means the following configuration in etc/org.ops4j.pax.url.mvn.cfg file:
>   -- org.ops4j.pax.url.mvn.settings=${karaf.etc}/settings.xml
>       where the settings.xml contains an "empty" settings.xml like:
>          <?xml version="1.0" encoding="UTF-8"?>
>          <settings></settings>
>   --
> org.ops4j.pax.url.mvn.localRepository=${karaf.home}/${karaf.default.repository}
>
>     to use the system repo as local by default (and not .m2/repository)
>   -- org.ops4j.pax.url.mvn.defaultRepositories=\
>        ${karaf.home}/${karaf.default.repository}@id=system@snapshots, \
>        ${karaf.data}/kar@id=kar@multi@snapshots
>   -- org.ops4j.pax.url.mvn.repositories=\
>        http://repo1.maven.org/maven2@id=central, \
>
> http://repository.springsource.com/maven/bundle/release@id=spring.ebr.release,
> \
>
> http://repository.springsource.com/maven/bundles/external@id=spring.ebr.external,
> \
>
> http://repository.apache.org/content/groups/snapshots-group@id=apache@snapshots@noreleases,
> \
>
> https://oss.sonatype.org/content/repositories/snapshots@id=sonatype.snapshots.deploy@snapshots@norelease,
> \
>
> https://oss.sonatype.org/content/repositories/ops4j-snapshots@id=ops4j.sonatype.snapshots.deploy@snapshots@noreleases
>
>
> - as an alternative, we document (both in the user guide and using
> comments in etc/org.ops4j.pax.url.mnv.cfg) how to switch in "development
> mode", meaning:
>    -- comment the org.ops4j.pax.url.mvn.settings property to use the
> user .m2/settings.xml
>    -- comment the org.ops4j.pax.url.mvn.localRepository property to use
> the user .m2/repository
>
> WDYT ?
>
> Regards
> JB
>
> On 08/31/2014 10:49 PM, Matt Sicker wrote:
>> Basically, the way I see it, in a developer setting, using your
>> .m2/repository makes sense as it's likely to have tons of libraries there
>> already. On production/staging/testing servers, however, it's far more
>> likely to contain things as much as possible. For instance, I may wish to
>> run Karaf as a user that has no home directory.
>>
>>
>> On 31 August 2014 15:43, Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:
>>
>>> Following this thread, I wonder if it doesn't make sense to add the
>>> system
>>> repo as local repo:
>>>
>>> org.ops4j.pax.url.mvn.localRepository=file:${karaf.home}/${karaf.default.
>>>
>>> repository}
>>>
>>> and override the default m2 settings with an empty one in Karaf:
>>>
>>> org.ops4j.pax.url.mvn.settings=${karaf.home}/${karaf.default.repository}/
>>>
>>> settings.xml
>>>
>>> by default, and document how to switch back to Maven "local user
>>> configuration".
>>>
>>> It would avoid to populate the .m2/repository and force to use the
>>> artifacts from the system repo (so very close to what we have in
>>> Karaf 2.x).
>>>
>>> WDYT ?
>>>
>>> Regards
>>> JB
>>>
>>>
>>> On 08/31/2014 10:31 PM, Matt Sicker wrote:
>>>
>>>> I quite like that change. In my Karaf usage, I've always
>>>> reconfigured the
>>>> .m2/repository directory to be inside KARAF_HOME instead just to
>>>> isolate
>>>> the repositories in the first place. Any sort of change that prefers
>>>> usage
>>>> of artifact repositories embedded in Karaf are a step forward IMO.
>>>>
>>>>
>>>> On 31 August 2014 14:36, Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:
>>>>
>>>>   Hi all,
>>>>>
>>>>> FYI, I aligned the etc/org.ops4j.pax.url.mvn.cfg files between master
>>>>> (Karaf 4.x) and Karaf 3.0.x.
>>>>>
>>>>> Basically, the change is to move the system repo and the kar repo as
>>>>> default repositories, instead of "regular" repositories.
>>>>>
>>>>> It allows Karaf to start quicker on a fresh machine, without any
>>>>> .m2/repository.
>>>>>
>>>>> Any objection ?
>>>>>
>>>>> Regards
>>>>> JB
>>>>> --
>>>>> Jean-Baptiste Onofré
>>>>> jbonofre@apache.org
>>>>> http://blog.nanthrax.net
>>>>> Talend - http://www.talend.com
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>> --
>>> Jean-Baptiste Onofré
>>> jbonofre@apache.org
>>> http://blog.nanthrax.net
>>> Talend - http://www.talend.com
>>>
>>
>>
>>
>

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

Re: [INFO] Update default etc/org.ops4j.pax.url.mvn.cfg on Karaf 3.0.x

Posted by Christian Schneider <ch...@die-schneider.net>.
Generally I agree with the production ready default.

I would like to see the development case covered better though. So I 
propose we have a build profile for karaf to create a karaf with 
development settings. This will allow a karaf developer to work with a 
snapshot karaf without tweaking configs.

Also as I wrote in the other mail I see big problems when using the 
system repo as local repo. Did you find a way to avoid that pax url 
writes into the system dir?

The ideal case for me would be that pax url caches all external bundles 
in the local repository but not the bundles in the system dir. So we 
would need to mark the system dir as read only but "local" to make sure 
the jars are not cached. I am not sure if this is possible though.

Christian


Am 01.09.2014 10:14, schrieb Jean-Baptiste Onofré:
> Hi Matt,
>
> I agree.
>
> Let me explain what I have in mind.
>
> Karaf can work in two modes:
> - by default, it should be standalone/atomic. I mean here that it 
> should not use any "external folders" like the .m2/repository folder.
> It means the following configuration in etc/org.ops4j.pax.url.mvn.cfg 
> file:
>  -- org.ops4j.pax.url.mvn.settings=${karaf.etc}/settings.xml
>      where the settings.xml contains an "empty" settings.xml like:
>         <?xml version="1.0" encoding="UTF-8"?>
>         <settings></settings>
>  -- 
> org.ops4j.pax.url.mvn.localRepository=${karaf.home}/${karaf.default.repository}
>    to use the system repo as local by default (and not .m2/repository)
>  -- org.ops4j.pax.url.mvn.defaultRepositories=\
> ${karaf.home}/${karaf.default.repository}@id=system@snapshots, \
>       ${karaf.data}/kar@id=kar@multi@snapshots
>  -- org.ops4j.pax.url.mvn.repositories=\
>       http://repo1.maven.org/maven2@id=central, \
>
> http://repository.springsource.com/maven/bundle/release@id=spring.ebr.release, 
> \
>
> http://repository.springsource.com/maven/bundles/external@id=spring.ebr.external, 
> \
>
> http://repository.apache.org/content/groups/snapshots-group@id=apache@snapshots@noreleases, 
> \
>
> https://oss.sonatype.org/content/repositories/snapshots@id=sonatype.snapshots.deploy@snapshots@norelease, 
> \
>
> https://oss.sonatype.org/content/repositories/ops4j-snapshots@id=ops4j.sonatype.snapshots.deploy@snapshots@noreleases 
>
>
> - as an alternative, we document (both in the user guide and using 
> comments in etc/org.ops4j.pax.url.mnv.cfg) how to switch in 
> "development mode", meaning:
>   -- comment the org.ops4j.pax.url.mvn.settings property to use the 
> user .m2/settings.xml
>   -- comment the org.ops4j.pax.url.mvn.localRepository property to use 
> the user .m2/repository
>
> WDYT ?
>
> Regards
> JB
>
> On 08/31/2014 10:49 PM, Matt Sicker wrote:
>> Basically, the way I see it, in a developer setting, using your
>> .m2/repository makes sense as it's likely to have tons of libraries 
>> there
>> already. On production/staging/testing servers, however, it's far more
>> likely to contain things as much as possible. For instance, I may 
>> wish to
>> run Karaf as a user that has no home directory.
>>
>>
>> On 31 August 2014 15:43, Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:
>>
>>> Following this thread, I wonder if it doesn't make sense to add the 
>>> system
>>> repo as local repo:
>>>
>>> org.ops4j.pax.url.mvn.localRepository=file:${karaf.home}/${karaf.default. 
>>>
>>> repository}
>>>
>>> and override the default m2 settings with an empty one in Karaf:
>>>
>>> org.ops4j.pax.url.mvn.settings=${karaf.home}/${karaf.default.repository}/ 
>>>
>>> settings.xml
>>>
>>> by default, and document how to switch back to Maven "local user
>>> configuration".
>>>
>>> It would avoid to populate the .m2/repository and force to use the
>>> artifacts from the system repo (so very close to what we have in 
>>> Karaf 2.x).
>>>
>>> WDYT ?
>>>
>>> Regards
>>> JB
>>>
>>>
>>> On 08/31/2014 10:31 PM, Matt Sicker wrote:
>>>
>>>> I quite like that change. In my Karaf usage, I've always 
>>>> reconfigured the
>>>> .m2/repository directory to be inside KARAF_HOME instead just to 
>>>> isolate
>>>> the repositories in the first place. Any sort of change that 
>>>> prefers usage
>>>> of artifact repositories embedded in Karaf are a step forward IMO.
>>>>
>>>>
>>>> On 31 August 2014 14:36, Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:
>>>>
>>>>   Hi all,
>>>>>
>>>>> FYI, I aligned the etc/org.ops4j.pax.url.mvn.cfg files between master
>>>>> (Karaf 4.x) and Karaf 3.0.x.
>>>>>
>>>>> Basically, the change is to move the system repo and the kar repo as
>>>>> default repositories, instead of "regular" repositories.
>>>>>
>>>>> It allows Karaf to start quicker on a fresh machine, without any
>>>>> .m2/repository.
>>>>>
>>>>> Any objection ?
>>>>>
>>>>> Regards
>>>>> JB
>>>>> -- 
>>>>> Jean-Baptiste Onofré
>>>>> jbonofre@apache.org
>>>>> http://blog.nanthrax.net
>>>>> Talend - http://www.talend.com
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>> -- 
>>> Jean-Baptiste Onofré
>>> jbonofre@apache.org
>>> http://blog.nanthrax.net
>>> Talend - http://www.talend.com
>>>
>>
>>
>>
>


-- 
  
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
Talend Application Integration Division http://www.talend.com