karaf-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tom Leung" <tom.le...@netage.com.hk>
Subject RE: Kar mechanic
Date Tue, 20 Aug 2013 04:47:11 GMT
herewith the script for uninstalling Jcomm under Karaf shell command, 
please take a look:

may fire the following command to cleanup JCOMM installation:

Karaf prompt> source c:\uninstall_jcomm.txt


Best Rgds
Tom


-----Original Message-----
From: A. Rothman [mailto:amichai2@amichais.net] 
Sent: Tuesday, August 20, 2013 3:36 AM
To: user@karaf.apache.org
Subject: Re: Kar mechanic


Other than all the issues detailed below? :-)

I understand that features and kars are both simple formats, which is nice. But I'd rather
not have to create and maintain them all manually... it's quite error prone and time consuming.
I was under the impression that the maven plugins (old/new) should be able to create features
and kars automatically from the maven dependency info so that everything can be built for
offline deployment, but I just can't seem to get them to work.

What's the current (working) best practices for creating/updating features files, and generating
kars from the project feature and dependency features so that it can all be deployed offline?

Thanks,

Amichai

On 08/19/2013 04:20 PM, Jean-Baptiste Onofré wrote:
> Hi,
>
> yes I do (and others ;)).
>
> The kar file is just a zip file containing a repository folder. This 
> folder contains both:
> - features XML files
> - all the bundles used in the features, using a Maven structure
> (groupId/artifactId/version/artifactId-version.jar)
>
> Do you haveissues with offline kar ?
>
> Regards
> JB
>
> On 08/19/2013 11:02 AM, A. Rothman wrote:
>>
>> Does anyone use kars for offline deployment? How do you do so?
>>
>> On 07/31/2013 09:53 PM, A. Rothman wrote:
>>> Hi!
>>>
>>> I have a maven project containing several modules and external 
>>> feature dependencies (e.g. cxf-dosgi feature), running in Karaf 
>>> 2.3.2, which will need to be deployed and updated offline (with no 
>>> internet access). Using features and kar files seems to be a perfect 
>>> fit, but I'm having trouble working with them. Here are my attempts 
>>> and results, which I hope someone can help me with.
>>>
>>> At first I tried plugin version 2.3.2, to match the Karaf version 
>>> I'm on (also tried earlier versions while trying to check some of 
>>> the issues, but the result was the same).
>>>
>>> 1. Trying to use the generate-features-xml goal as described in 
>>> http://karaf.apache.org/manual/latest-2.3.x/developers-guide/feature
>>> s-maven-plugin-generate.html
>>>
>>> resulted in an error:
>>>    [ERROR] Failed to execute goal
>>> org.apache.karaf.tooling:features-maven-plugin:2.3.2:generate-featur
>>> es-xml
>>>
>>> (generate) on project server: Unable to create features.xml file:
>>> org.apache.maven.artifact.resolver.ArtifactNotFoundException: 
>>> Failure to find org.eclipse:osgi:jar:3.8.0.v20120529-1548 in
>>> http://repo.maven.apache.org/maven2 was cached in the local 
>>> repository, resolution will not be reattempted until the update 
>>> interval of central has elapsed or updates are forced
>>>
>>> 2. Running the create-kar goal with a manually created features.xml 
>>> file works, but... the external dependency features seem to be 
>>> ignored
>>> - no separate kars are generated from them, and they are not 
>>> embedded in the main project kar (it would be nice to have both of 
>>> these as options).
>>>
>>> 3. I tried manually adding executions to create kar files for the 
>>> external features, but neither a mvn url or a full http url work - 
>>> it appears the featuresFile parameter supports only a local file. So 
>>> what's the proper way to get the external features into kars 
>>> (individual or embedded) for offline deployment?
>>>
>>> Next, I tried my luck with the newer karaf-maven-plugin (currently 
>>> released only in version 3.0.0.RC1),  using docs at 
>>> http://karaf.apache.org/manual/latest/developers-guide/karaf-maven-plugin.html.
>>>
>>>
>>>
>>> 4. The features-generate-descriptor goal no longer has the 
>>> kernelVersion parameter that the old generate-features-xml had - how 
>>> does it decide which bundles/features are installed by default and 
>>> should not be included as duplicates?
>>>
>>> 5. Setting aggregateFeatures and includeTransitiveDependency to 
>>> true, the external dependency features still seem to be ignored.
>>>
>>> 6. I did hit KARAF-1972 though, which is still unresolved. I'm not 
>>> sure yet if this is just ugly but will work, or if it might actually 
>>> cause trouble when deployed (in my case it included osgi core and 
>>> compendium bundles in the kar).
>>>
>>> 7. It seems the new recommended way of doing things in the new 
>>> plugin is via <packaging>kar</packaging>. However when I tried 
>>> changing the packaging from pom to kar I get an error:
>>> [ERROR] Failed to execute goal
>>> org.apache.karaf.tooling:karaf-maven-plugin:3.0.0.RC1:features-creat
>>> e-kar
>>>
>>> (default-features-create-kar) on project server: Execution 
>>> default-features-create-kar of goal 
>>> org.apache.karaf.tooling:karaf-maven-plugin:3.0.0.RC1:features-creat
>>> e-kar
>>>
>>> failed: For artifact {com.example.server:server:0.1-SNAPSHOT:kar}: 
>>> An attached artifact must have a different ID than its corresponding 
>>> main artifact. -> [Help 1]  (the ID is unique, and I tried changing 
>>> it too, but still get this error. I do have extensions set to true, 
>>> fwiw.)
>>>
>>> A couple more things that made my attempts a bit less fun:
>>>
>>> 8. Some documentation/website typos I came across:
>>> http://karaf.apache.org/manual/latest-2.3.x/developers-guide/feature
>>> s-maven-plugin.html
>>>
>>> - the link to create-kar goal in the table at the top of the page is 
>>> messed up.
>>> http://karaf.apache.org/manual/latest-2.3.x/developers-guide/brandin
>>> g-console.html
>>>
>>> - user variable is shown as $}, which I'm guessing is a typo.
>>> http://karaf.apache.org/manual/latest-2.3.x/users-guide/provisioning
>>> .html
>>>
>>> - last link (to custom build) is broken.
>>> http://karaf.apache.org/manual/latest-2.3.x/developers-guide/feature
>>> s-maven-plugin-create-kar.html
>>>
>>> - a parameter named {{resourcesDir} is probably a typo. Also the 
>>> default parameter values look fishy (I've seen this elsewhere too).
>>>     It looks like those and other typos revolve around invalid use 
>>> of curly braces - perhaps you can set up a regex to detect the 
>>> invalid usages and fail the website build accordingly, or at least 
>>> run a one-time grep and fix all of those.
>>>
>>> 9. The docs, examples and configuration parameters and default 
>>> values use feature.xml/features.xml/feature repository 
>>> interchangeably, which is a bit confusing until one reads enough to 
>>> realize they're all the same. It would be clearer to pick a standard 
>>> xml name and standard terminology for it and be consistent everywhere.
>>>
>>>
>>> So, can anyone help understand/document/workaround/fix any of these?
>>> And is there any way to get external features into kars for offline 
>>> deployment? I'm aware of the alternative of building a custom 
>>> pre-installed karaf distribution, though I haven't gone down that 
>>> path yet - I'm still hoping kars are usable since they seem to 
>>> better fit my needs.
>>>
>>> Thanks!
>>>
>>> Amichai
>>>
>>>
>>>
>>>
>>
>>
>


Mime
View raw message