Hi,

Yes, you can add additional local repository just by editing
etc/org.ops4j.pax.url.mvn.cfg.

To populate the Maven repository, you can use the regular mvn deploy,
mvn deploy-file, etc commands.
You can also use Cave Repository/Deployer able to upload artifact.

+1 to create a Jira about variable. It's actually already partly
possible ({karaf.etc}, {karaf.base}, should work for instance), but I
would like to improve it a bit.

For Cave, you can:

1. Create a repository using:

karaf@root()> cave:repository-create my-repo

2. Upload artifact using in this repo using:

karaf@root()> cave:repository-artifact-add myrepo
mvn:commons-lang/commons-lang/2.6

or regular mvn command.

3. You can directly use the artifacts in Karaf. Just add the Cave
repository URL in etc/org.ops4j.pax.url.mvn.cfg, and then you can use
mvn in Karaf. You can also use http to access the Cave repository.

4. If you really want (but I don't see the value), you can still create
the OBR descriptor using:

karaf@root()> cave:repository-update-bundle-descriptor myrepo

NB: a repository can also be a mirror or proxy to another one, and you
can also define a trigger action on a repository.

I suggest to take a look on:

https://github.com/apache/karaf-cave/blob/master/manual/src/main/asciidoc/user-guide/repository.adoc

I'm publishing the updated documentation on Karaf website now.

Regards
JB

On 05/11/2019 17:22, Giamma wrote:
> Hello,
> 
> On Tue, Nov 5, 2019 at 2:46 PM Jean-Baptiste Onofré <[email protected]
> <mailto:[email protected]>> wrote:
> 
>     Hi,
> 
>     I have some comments: why not using directly Karaf instead of inside
>     Virgo ?
> 
> 
> I am using Karaf directly, I just mentioned Virgo and Liberty to explain
> that I am more familiar with OBR bundle repositories.
> 
>     Why can't you use mvn ? You can always provision the Karaf system folder
>     which is actually an embedded Maven repository.
> 
> 
> I am new to Karaf, I did not know. I suppose I could also add another
> folder if I wanted to keep my artifacts separate to be able to purge and
> recreate the repo more easily.
> However, how do you create a m2 structure from a maven project? does the
> maven deploy plugin allows you to automate this for a project including
> its dependencies?
> I hope I do not have to install one bundle at a time via mvn install.
>  
> 
>     Variable substitution is not supported yet (it's a good idea by the way,
>     and worth to create a Jira), but you can prepare it at buildtime.
> 
> 
> Do you want me to open an enhancement request?
> 
>     Cave basically provides two things:
>     - Cave repository is interesting for you as it can store any kind of
>     artifacts that you can use in your Karaf instances
>     - Cave Features Gateway is just a "wrapper" of multiple features XML in
>     one big XML. You just do the feature:repo-add of the Gateway XML instead
>     of each individual XML locations. The gateway XML is managed by service.
> 
>     Don't hesitate to ping me directly if you need more details or advices.
> 
> 
> I would like to understand better how I can create a repo and populate
> it with all the bundles in a folder using Cave 4.2.0. I could not figure
> out how to do that from the shell, it looks like this was possible in
> 4.1 but the 4.2 shell is missing some commands that existed before.
> Maybe it is possible to populate a cave repo starting from a feature?
> 

-- 
Jean-Baptiste Onofré
[email protected]
http://blog.nanthrax.net
Talend - http://www.talend.com

Reply via email to