You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Serge Huber <sh...@jahia.com> on 2017/02/01 11:17:10 UTC

"Patching" bundle installed from startup.properties

Hello,

I’m running into this problem on my Karaf 3.0.8 application : https://issues.apache.org/jira/browse/ARIES-1540 <https://issues.apache.org/jira/browse/ARIES-1540>

Since the version of CXF that corrects this is not out yet I need to update the org.apache.aries.blueprint.core version from 1.6.1 to 1.6.2 which includes a fix for offline startup. 

The problem is that in Karaf 3 this bundle is installed from the startup.properties, and I’m using the karaf-maven-plugin to build an archive for my application (Apache Unomi). 

From what I see I have two options:
1. provide a custom startup.properties and copy the org.apache.aries.blueprint.core-1.6.2.jar to the system directory manually 
2. provide a new framework KAR that copies the original one and modifies the version

I tried using the “overrides.properties” file but it doesn’t work for this in Karaf 3 since it only work for features that are deployed on startup. 

Currently I have this in my Maven build : 

<dependency>
    <!-- scope is compile so all features (there is only one) are installed into startup.properties and the feature repo itself is not installed -->
    <groupId>org.apache.karaf.features</groupId>
    <artifactId>framework</artifactId>
    <type>kar</type>
</dependency>
...
<plugin>
    <groupId>org.apache.karaf.tooling</groupId>
    <artifactId>karaf-maven-plugin</artifactId>
    <executions>
        <execution>
            <id>install-kar</id>
            <phase>compile</phase>
            <goals>
                <goal>install-kars</goal>
            </goals>
        </execution>
        <execution>
            <id>package</id>
            <goals>
                <goal>instance-create-archive</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <installedFeatures>
            <feature>wrapper</feature>
        </installedFeatures>
        <bootFeatures>
            <feature>standard</feature>
            <feature>management</feature>
            <feature>ssh</feature>
            <feature>config</feature>
            <feature>region</feature>
            <feature>package</feature>
            <feature>kar</feature>
            <feature>war</feature>
            <feature>cxf</feature>
            <feature>cellar</feature>
            <feature>unomi-kar</feature>
        </bootFeatures>
    </configuration>
</plugin>
Would it work if I define a second compile-time dependency that provides a second bundle with a different version ? Would it override the first one ? 

cheers,
  Serge… 


Re: "Patching" bundle installed from startup.properties

Posted by Serge Huber <sh...@jahia.com>.
Thanks for the very quick reply, I just tested doing that and it works, I just had to deploy the updated bundle in the system directory of the archive.

cheers,
  Serge.. 

> On 1 Feb 2017, at 12:24, Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:
> 
> Hi,
> 
> I don't think it gonna work with Karaf 3.x. The easiest move is to provide a custom startup.properties in your custom distribution.
> 
> Regards
> JB
> 
> On 02/01/2017 12:17 PM, Serge Huber wrote:
>> Hello,
>> 
>> I’m running into this problem on my Karaf 3.0.8 application
>> : https://issues.apache.org/jira/browse/ARIES-1540
>> 
>> Since the version of CXF that corrects this is not out yet I need to
>> update the org.apache.aries.blueprint.core version from 1.6.1 to 1.6.2
>> which includes a fix for offline startup.
>> 
>> The problem is that in Karaf 3 this bundle is installed from the
>> startup.properties, and I’m using the karaf-maven-plugin to build an
>> archive for my application (Apache Unomi).
>> 
>> From what I see I have two options:
>> 1. provide a custom startup.properties and copy the
>> org.apache.aries.blueprint.core-1.6.2.jar to the system directory manually
>> 2. provide a new framework KAR that copies the original one and modifies
>> the version
>> 
>> I tried using the “overrides.properties” file but it doesn’t work for
>> this in Karaf 3 since it only work for features that are deployed on
>> startup.
>> 
>> Currently I have this in my Maven build :
>> 
>> <dependency>
>>    <!-- scope is compile so all features (there is only one) are installed
>> into startup.properties and the feature repo itself is not installed -->
>> <groupId>org.apache.karaf.features</groupId>
>>    <artifactId>framework</artifactId>
>>    <type>kar</type>
>> </dependency>
>> 
>> ...
>> 
>> <plugin>
>>    <groupId>org.apache.karaf.tooling</groupId>
>>    <artifactId>karaf-maven-plugin</artifactId>
>>    <executions>
>>        <execution>
>>            <id>install-kar</id>
>>            <phase>compile</phase>
>>            <goals>
>>                <goal>install-kars</goal>
>>            </goals>
>>        </execution>
>>        <execution>
>>            <id>package</id>
>>            <goals>
>>                <goal>instance-create-archive</goal>
>>            </goals>
>>        </execution>
>>    </executions>
>>    <configuration>
>>        <installedFeatures>
>>            <feature>wrapper</feature>
>>        </installedFeatures>
>>        <bootFeatures>
>>            <feature>standard</feature>
>>            <feature>management</feature>
>>            <feature>ssh</feature>
>>            <feature>config</feature>
>>            <feature>region</feature>
>>            <feature>package</feature>
>>            <feature>kar</feature>
>>            <feature>war</feature>
>>            <feature>cxf</feature>
>>            <feature>cellar</feature>
>>            <feature>unomi-kar</feature>
>>        </bootFeatures>
>>    </configuration>
>> </plugin>
>> 
>> Would it work if I define a second compile-time dependency that provides
>> a second bundle with a different version ? Would it override the first
>> one ?
>> 
>> cheers,
>>  Serge…
>> 
> 
> -- 
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com


Re: "Patching" bundle installed from startup.properties

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,

I don't think it gonna work with Karaf 3.x. The easiest move is to 
provide a custom startup.properties in your custom distribution.

Regards
JB

On 02/01/2017 12:17 PM, Serge Huber wrote:
> Hello,
>
> I\u2019m running into this problem on my Karaf 3.0.8 application
> : https://issues.apache.org/jira/browse/ARIES-1540
>
> Since the version of CXF that corrects this is not out yet I need to
> update the org.apache.aries.blueprint.core version from 1.6.1 to 1.6.2
> which includes a fix for offline startup.
>
> The problem is that in Karaf 3 this bundle is installed from the
> startup.properties, and I\u2019m using the karaf-maven-plugin to build an
> archive for my application (Apache Unomi).
>
> From what I see I have two options:
> 1. provide a custom startup.properties and copy the
> org.apache.aries.blueprint.core-1.6.2.jar to the system directory manually
> 2. provide a new framework KAR that copies the original one and modifies
> the version
>
> I tried using the \u201coverrides.properties\u201d file but it doesn\u2019t work for
> this in Karaf 3 since it only work for features that are deployed on
> startup.
>
> Currently I have this in my Maven build :
>
> <dependency>
>     <!-- scope is compile so all features (there is only one) are installed
> into startup.properties and the feature repo itself is not installed -->
> <groupId>org.apache.karaf.features</groupId>
>     <artifactId>framework</artifactId>
>     <type>kar</type>
> </dependency>
>
> ...
>
> <plugin>
>     <groupId>org.apache.karaf.tooling</groupId>
>     <artifactId>karaf-maven-plugin</artifactId>
>     <executions>
>         <execution>
>             <id>install-kar</id>
>             <phase>compile</phase>
>             <goals>
>                 <goal>install-kars</goal>
>             </goals>
>         </execution>
>         <execution>
>             <id>package</id>
>             <goals>
>                 <goal>instance-create-archive</goal>
>             </goals>
>         </execution>
>     </executions>
>     <configuration>
>         <installedFeatures>
>             <feature>wrapper</feature>
>         </installedFeatures>
>         <bootFeatures>
>             <feature>standard</feature>
>             <feature>management</feature>
>             <feature>ssh</feature>
>             <feature>config</feature>
>             <feature>region</feature>
>             <feature>package</feature>
>             <feature>kar</feature>
>             <feature>war</feature>
>             <feature>cxf</feature>
>             <feature>cellar</feature>
>             <feature>unomi-kar</feature>
>         </bootFeatures>
>     </configuration>
> </plugin>
>
> Would it work if I define a second compile-time dependency that provides
> a second bundle with a different version ? Would it override the first
> one ?
>
> cheers,
>   Serge\u2026
>

-- 
Jean-Baptiste Onofr�
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com