Hi Oliver,
what ever you put into the system folder, if you use a SNAPSHOT
artifact, you can update on the fly with bundle:update and bundle:watch.
By default, bundle:update/bundle:watch take the bundle location
(containing the mvn URL), and check in your local maven repository
($HOME/.m2/repository of the user who launch Karaf) for new artifact.
However, the default Karaf configuration is for "production" purpose.
For development, you have to change a bit the
etc/org.ops4j.pax.url.mvn.cfg file.
Especially,
org.ops4j.pax.url.mvn.defaultLocalRepoAsRemote=false
...
#org.ops4j.pax.url.mvn.defaultRepositories=
...
org.ops4j.pax.url.mvn.repositories= \
...
file:${karaf.home}/${karaf.default.repository}@id=systemrepo, \
file:${karaf.data}/kar@id=karrepos@multi
will allow you to switch in dev mode (instead of production mode).
I will create a Jira to document this (and add comments directly in the
file).
Regards
JB
On 10/17/2014 08:39 PM, Oliver Pajonk wrote:
Hi all,
following up on the latest issue with bundle:watch I have a related
question. I am using the "standard" (as in documented here
<http://karaf.apache.org/manual/latest/developers-guide/custom-distribution.html>)
way to construct a Karaf instance which would run my feature (and a few
related ones). Both feature and distribution are created with
the karaf-maven-plugin, so all bundles get installed into the system
repository to make a self-sufficient distribution.
However, what if I want to do bundle development with this setup? I have
tried to use bundle:update in this scenario, but enabling DEBUG log
output confirmed my suspicion: Karaf does not look in my local Maven
repository for updated SNAPSHOT bundles; it just grabs it from the
system repository [1] - where it is not updated, of course, when I call
mvn install for a bundle project.
My question is therefore: what do you suggest as a "least effort"
development cycle, involving bundle:update and (when it works again)
bundle:watch? A link to a blogpost, a few lines of description, anything
will help :-) Google did not really turn up something for me...
Best regards,
Oliver
[1] Log from a bundle:update call:
2014-10-17 20:31:52,039 | DEBUG | h for user karaf | Connection
| 1 - org.ops4j.pax.url.mvn - 2.2.0 | Resolving
[mvn:obfuscatedgroupid/obfuscatedartifactid/0.0.1-SNAPSHOT]
2014-10-17 20:31:52,039 | DEBUG | h for user karaf |
DefaultLocalRepositoryProvider | 1 - org.ops4j.pax.url.mvn - 2.2.0 |
Using manager SimpleLocalRepositoryManager with priority 0.0 for
D:\Dev\Eclipse\Misc\obfuscatedapp\karaf-application\application\target\assembly\system
2014-10-17 20:31:52,039 | DEBUG | h for user karaf | AetherBasedResolver
| 1 - org.ops4j.pax.url.mvn - 2.2.0 | Resolved
(obfuscatedgroupid:obfuscatedartifactid:jar:0.0.1-SNAPSHOT) as
D:\Dev\Eclipse\Misc\obfuscatedapp\karaf-application\application\target\assembly\system\some\where\obfuscatedartifactid\0.0.1-SNAPSHOT\obfuscatedartifactid-0.0.1-SNAPSHOT.jar
--
Jean-Baptiste Onofré
[email protected]
http://blog.nanthrax.net
Talend - http://www.talend.com