You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by jochenw <jo...@googlemail.com> on 2014/05/01 20:17:06 UTC
Karaf 3.0.1: how to avoid usage of .m2 repository?
We are using Karaf 3.0.1 on a system which doesn't have an internet
connection. For installation of additional feature (ActiveMQ, Camel), we
created a local maven repository. Our application bundles were initially
installed via file:/// (when we still used Karaf 2.3.3), with 3.0.1 we now
also use a maven repository due to the still unsolved 30-seconds-timeout
problem with file:///.
Recently we faced a problem of bundles not being updated and found out that
in Karaf 3.0.1, all additional feature bundles are installed in .m2 in the
user's home directory, and they seem to only be updated if bundles there
have a time stamp older than 24 hours.
Question 1:
Is is possible to configure Karaf 3.0.1 to not create and use a .m2
repository in the installing user's home dir? I have searched the options in
org.ops4j.pax.url.mvn.cfg but it wasn't obvious to me how to achieve this.
I'd like to avoid side-effects introduced by .m2 usage, and since bundles
are anyways not fetched from remote, I don't see an advantage. (Using
org.ops4j.pax.url.mvn.globalUpdatePolicy=always might solve the update
problem as a workaround - but doesn't look like a clean solution to me.)
Question 2 (rather generic, I know):
Is there some best practice how to install an application in Karaf in a
production environment?
Thanks,
Jochen
--
View this message in context: http://karaf.922171.n3.nabble.com/Karaf-3-0-1-how-to-avoid-usage-of-m2-repository-tp4033016.html
Sent from the Karaf - User mailing list archive at Nabble.com.
Re: Karaf 3.0.1: how to avoid usage of .m2 repository?
Posted by jochenw <jo...@googlemail.com>.
Hi Jeremy,
yes, this will force local-only repos (and actually my settings are close to
yours). However, changing the localRepository just replaces usage of
.m2/repository in the user's home folder. So still it will first look for
bundles in ${karaf.data}/repository, and it is not guaranteed that it takes
newer bundles from a repo in the org.ops4j.pax.url.mvn.repositories list.
By the way: even then, the .m2 folder is created, but is kept empty.
Although that does no harm, it doesn't look nice on a production system.
Regards,
Jochen
--
View this message in context: http://karaf.922171.n3.nabble.com/Karaf-3-0-1-how-to-avoid-usage-of-m2-repository-tp4033016p4033019.html
Sent from the Karaf - User mailing list archive at Nabble.com.
Re: Karaf 3.0.1: how to avoid usage of .m2 repository?
Posted by Jeremy Jongsma <je...@barchart.com>.
We use these settings to force local-only repos (in
org.ops4j.pax.url.mvn.cfg):
org.ops4j.pax.url.mvn.localRepository=${karaf.data}/repository
org.ops4j.pax.url.mvn.useFallbackRepositories=false
org.ops4j.pax.url.mvn.repositories=file:${karaf.home}/system/@id=karaf-system,file:${karaf.data}/kar/@id=karaf-kar@multi
On Thu, May 1, 2014 at 1:17 PM, jochenw <jo...@googlemail.com>wrote:
> We are using Karaf 3.0.1 on a system which doesn't have an internet
> connection. For installation of additional feature (ActiveMQ, Camel), we
> created a local maven repository. Our application bundles were initially
> installed via file:/// (when we still used Karaf 2.3.3), with 3.0.1 we now
> also use a maven repository due to the still unsolved 30-seconds-timeout
> problem with file:///.
>
> Recently we faced a problem of bundles not being updated and found out that
> in Karaf 3.0.1, all additional feature bundles are installed in .m2 in the
> user's home directory, and they seem to only be updated if bundles there
> have a time stamp older than 24 hours.
>
> Question 1:
> Is is possible to configure Karaf 3.0.1 to not create and use a .m2
> repository in the installing user's home dir? I have searched the options
> in
> org.ops4j.pax.url.mvn.cfg but it wasn't obvious to me how to achieve this.
> I'd like to avoid side-effects introduced by .m2 usage, and since bundles
> are anyways not fetched from remote, I don't see an advantage. (Using
> org.ops4j.pax.url.mvn.globalUpdatePolicy=always might solve the update
> problem as a workaround - but doesn't look like a clean solution to me.)
>
> Question 2 (rather generic, I know):
> Is there some best practice how to install an application in Karaf in a
> production environment?
>
> Thanks,
>
> Jochen
>
>
>
>
>
> --
> View this message in context:
> http://karaf.922171.n3.nabble.com/Karaf-3-0-1-how-to-avoid-usage-of-m2-repository-tp4033016.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>
Re: Karaf 3.0.1: how to avoid usage of .m2 repository?
Posted by jochenw <jo...@googlemail.com>.
If you place your stuff in the system directory, I don't see the need to
change the default configuration. This folder is already included in the
defaultRepositories in org.ops4j.pax.url.mvn.cfg.
Define features according to
http://karaf.apache.org/manual/latest/users-guide/provisioning.html
<http://karaf.apache.org/manual/latest/users-guide/provisioning.html> and
add the features to the featuresRepositories list in
org.apache.karaf.features.cfg. Then you can install a feature with
feature:install <featurename>. If you add the feature to the featuresBoot
list in org.apache.karaf.features.cfg, it will automatically be installed on
startup.
BR,
Jochen
--
View this message in context: http://karaf.922171.n3.nabble.com/Karaf-3-0-1-how-to-avoid-usage-of-m2-repository-tp4033016p4037685.html
Sent from the Karaf - User mailing list archive at Nabble.com.
Re: Karaf 3.0.1: how to avoid usage of .m2 repository?
Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
For the xxx times, I already replied ;)
AFAIR, I updated the documentation (let me check and update).
The current 3.0.3-SNAPSHOT version already use a production mode
configuration.
Regards
JB
On 01/08/2015 09:00 AM, Srikanth wrote:
> I am also facing similar issue in karaf 3.0.0.
> Could you please send me the configuration?
>
> I have all my artifacts in {karaf.home}/system directory, and want karaf to
> access all the artifacts from system directory.
>
> Basically i dont want artifacts to be downloaded and .m2 directory to be
> created.
>
>
>
> -----
> www.gharki.com
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Karaf-3-0-1-how-to-avoid-usage-of-m2-repository-tp4033016p4037678.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: Karaf 3.0.1: how to avoid usage of .m2 repository?
Posted by Srikanth <sr...@gmail.com>.
I am also facing similar issue in karaf 3.0.0.
Could you please send me the configuration?
I have all my artifacts in {karaf.home}/system directory, and want karaf to
access all the artifacts from system directory.
Basically i dont want artifacts to be downloaded and .m2 directory to be
created.
-----
www.gharki.com
--
View this message in context: http://karaf.922171.n3.nabble.com/Karaf-3-0-1-how-to-avoid-usage-of-m2-repository-tp4033016p4037678.html
Sent from the Karaf - User mailing list archive at Nabble.com.
Re: Karaf 3.0.1: how to avoid usage of .m2 repository?
Posted by jochenw <jo...@googlemail.com>.
Just for completeness:
In the meantime, I'm using Karaf 3.0.2. I now have the repository for my own
bundles in an extra folder under the Karaf home directory, and have added
this folder to the org.ops4j.pax.url.mvn.defaultRepositories.
All entries in org.ops4j.pax.url.mvn.repositories have been removed, since
there should be no extra things installable in the production environment.
All the features I need are included in a custom distribution which I have
built - works great.
When I need an update for my own bundles, I just copy them into my special
folder (overwriting what is already there), including an updated feature xml
file if needed (additional / removed bundles). Then I remove the feature,
update the repo, and re-install the feature. Rather rough way, but it works
for all cases. I'm thinking of some improvement (ACE etc.), but that might
be another thread.
No more extra mvn dirs are created, so that problem is solved.
Thanks again for the help!
Best Regards,
Jochen
--
View this message in context: http://karaf.922171.n3.nabble.com/Karaf-3-0-1-how-to-avoid-usage-of-m2-repository-tp4033016p4036357.html
Sent from the Karaf - User mailing list archive at Nabble.com.
Re: Karaf 3.0.1: how to avoid usage of .m2 repository?
Posted by jochenw <jo...@googlemail.com>.
Thanks, Achim!
Yes, placing the additional repos in the defaultRepositories would make the
resolver to look there even before it checks the local repo. This would
solve my problem with newer bundle version, while I assume that the local
.m2 repo will still be created.
However, when I place my repos in the defaultRepositories instead of adding
them to org.ops4j.pax.url.mvn.repositories, the AetherBasedResolver throws
an exception that it cannot find the respective artifacts. It seems that all
repos in org.ops4j.pax.url.mvn.defaultRepositories are just neglected.
Changing the org.ops4j.pax.url.mvn.disableAether to true or false doesn't
make any difference.
I'm not sure whether I did something wrong or whether I stumbled over a bug
in Karaf 3.0.1.
Regards,
Jochen
--
View this message in context: http://karaf.922171.n3.nabble.com/Karaf-3-0-1-how-to-avoid-usage-of-m2-repository-tp4033016p4033021.html
Sent from the Karaf - User mailing list archive at Nabble.com.
Re: Karaf 3.0.1: how to avoid usage of .m2 repository?
Posted by Achim Nierbeck <bc...@googlemail.com>.
Hi,
Q1:
yes it is. Use a default repository. Add a line like the following to your
org.ops4j.pax.url.mvn.cfg file:
org.ops4j.pax.url.mvn.defaultRepositories=file:<any-location>@snapshots
Q2:
one is to create a custom distribution with all required bundles located in
your system path.
Take a look at [1].
regards, Achim
[1] -
http://karaf.apache.org/manual/latest/developers-guide/custom-distribution.html
2014-05-01 20:17 GMT+02:00 jochenw <jo...@googlemail.com>:
> We are using Karaf 3.0.1 on a system which doesn't have an internet
> connection. For installation of additional feature (ActiveMQ, Camel), we
> created a local maven repository. Our application bundles were initially
> installed via file:/// (when we still used Karaf 2.3.3), with 3.0.1 we now
> also use a maven repository due to the still unsolved 30-seconds-timeout
> problem with file:///.
>
> Recently we faced a problem of bundles not being updated and found out that
> in Karaf 3.0.1, all additional feature bundles are installed in .m2 in the
> user's home directory, and they seem to only be updated if bundles there
> have a time stamp older than 24 hours.
>
> Question 1:
> Is is possible to configure Karaf 3.0.1 to not create and use a .m2
> repository in the installing user's home dir? I have searched the options
> in
> org.ops4j.pax.url.mvn.cfg but it wasn't obvious to me how to achieve this.
> I'd like to avoid side-effects introduced by .m2 usage, and since bundles
> are anyways not fetched from remote, I don't see an advantage. (Using
> org.ops4j.pax.url.mvn.globalUpdatePolicy=always might solve the update
> problem as a workaround - but doesn't look like a clean solution to me.)
>
> Question 2 (rather generic, I know):
> Is there some best practice how to install an application in Karaf in a
> production environment?
>
> Thanks,
>
> Jochen
>
>
>
>
>
> --
> View this message in context:
> http://karaf.922171.n3.nabble.com/Karaf-3-0-1-how-to-avoid-usage-of-m2-repository-tp4033016.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>
--
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
Project Lead
blog <http://notizblog.nierbeck.de/>
Software Architect / Project Manager / Scrum Master