These are two different caches. The difference between them is mainly the lifecycle. The bundle cache is an OSGi feature. It caches the loaded bundles of the OSGi framework. So if you start karaf with -clean this cache is deleted. The .m2 cache has a longer lifetime and can also be shared by different karaf instances on the server.

To make life for admins easier I often suggest to always start karaf with -clean and use boot features to define what should run. This makes karaf very easy to understand for an admin as he knows what will come up when karaf is started. Of course you loose some of the OSGi dynamics this way but on the other hand some things are a lot easier. For example to upgrade your application simply point the feature repos to the new version and restart.

So when using this mode of operation the .m2 repository is quite useful.

Christian

On 25.07.2014 20:45, thully wrote:
This issue did raise another question - if Karaf 3 is using .m2 to cache
bundles, what is the Karaf bundle cache in ${karaf.data} for? It seems like
you're storing a redundant copy of each bundle, or 2 redundant copies in the
case of the system repository...  Caching makes perfect sense, but not when
we already have a cached copy...



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Disabling-local-repository-creation-on-Karaf-3-tp4034426p4034456.html
Sent from the Karaf - User mailing list archive at Nabble.com.


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

Open Source Architect
http://www.talend.com

Reply via email to