Re: Karaf Maven Plugin / Depedent features

2022-08-08 Thread Steinar Bang
> Ephemeris Lappis :

> Hello.
> I can't find any way to add dependent features to the feature I try to
> generate using the maven plugin.

> The maven dependencies are added as expected with the matching bundles.

> How can I add features ? I've tried putting a feature.xml file in the
> src/main/feature folder, but then the generation just copy this file
> and do not update it...

Hm... my template.xml files are expanded the way I expect them to be.

What version of karaf-maven-plugin are you using?

Here is one of my src/main/feature/feature.xml files
 
https://github.com/steinarb/liquibase-karaf-feature/blob/master/liquibase-integration-test/karaf.liquibase.sample/src/main/feature/feature.xml#L16

This template feature.xml contains feature dependencies for a feature
with a name set by the maven property karaf-feature-name, and a
handwritten jdbc-config feature that depends on the feature with name
defined by maven property karaf-feature-name and the pax-jdbc-config
feature.

In addition, the pom.xml for the project defines the karaf-feature-name
property,
 
https://github.com/steinarb/liquibase-karaf-feature/blob/master/liquibase-integration-test/karaf.liquibase.sample/pom.xml#L28
and a dependency to the liquibase feature (discussed in a different
thread):
 
https://github.com/steinarb/liquibase-karaf-feature/blob/master/liquibase-integration-test/karaf.liquibase.sample/pom.xml#L32

This template is transformed into the following file in 
target/feature/feature.xml :
 https://gist.github.com/steinarb/6b49cb2a6eeba74186d754683e97c958
 
 1. The maven feature dependency of the pom is turned into an import
 
https://gist.github.com/steinarb/6b49cb2a6eeba74186d754683e97c958#file-feature-xml-L3
and a versioned feature dependency
 
https://gist.github.com/steinarb/6b49cb2a6eeba74186d754683e97c958#file-feature-xml-L8
 2. The feature with name given by maven property karaf-feature-name has
the property expanded and gets a description and version values
provided by the pom
 3. The unversioned feature dependencies scr and pax-jdbc-derby are kept
from the template feature.xml
 
https://gist.github.com/steinarb/6b49cb2a6eeba74186d754683e97c958#file-feature-xml-L6
 4. The jdbc-config feature "sample-db" is copied from the template
feature.xml
 
https://gist.github.com/steinarb/6b49cb2a6eeba74186d754683e97c958#file-feature-xml-L11



Re: Karaf Maven Plugin / Depedent features

2022-08-08 Thread Ephemeris Lappis
Hello again.

Good idea ! adding this configuration to the plugin :


camel-blueprint



The needed feature "camel-blueprint" is marked as dependency, but all
other features are still in my result :
.../...
xml-specs-api
camel
camel-core
camel-catalog
camel-blueprint
camel-spring
.../...

No way to keep only my actual dependencies...

Thanks again.

Regards.

Le lun. 8 août 2022 à 15:43, Richard Hierlmeier
 a écrit :
>
> Did you try the dependencyFeatures option:
>
> I got this option with the following maven
> mvn org.apache.maven.plugins:maven-help-plugin:3.2.0:describe 
> -Dcmd=org.apache.karaf.tooling:karaf-maven-plugin:features-generate-descriptor
>  -Ddetail
>  ...
>  dependencyFeatures
>   Name of features which are dependencies (they still need to be defined
>   separately).
>
> Regards
>Richard
>
> Am Mo., 8. Aug. 2022 um 14:03 Uhr schrieb Ephemeris Lappis 
> :
>>
>> Hello.
>>
>> Thanks for your reply, Richard, but for now I'd prefer to use
>> dependencies to create the features for our bundles, and rely on BOM
>> version management.
>>
>> I've found a post talking about feature maven dependency declaration.
>> In my case, for camel features, this should be something like that :
>>
>> 
>> org.apache.camel.karaf
>> apache-camel
>> ${version.of.camel}
>> features
>> xml
>> 
>>
>> This declaration perhaps should work, but has two drawbacks for now :
>> - all the camel features that are in this feature repository are
>> identified as features in mine : in my case I just want
>> camel-blueprint and its transitive dependent features
>> - none of them is marked as requirement : > prerequisite="false" dependency="false">camel-blueprint
>>
>> Another idea to go this way ;) ?
>>
>> Anyway to limit dependencies to individual features, and make them
>> automatically installed by Karaf when installing our feature?
>>
>> Thanks again.
>>
>> Regards.
>>
>> Le lun. 8 août 2022 à 13:40, Richard Hierlmeier
>>  a écrit :
>> >
>> > I have the same problem. I define feature dependencies in
>> >
>> > src/main/feature/features.xml
>> >
>> > For each feature dependency I have to define in the pom a version or 
>> > version range property.
>> >
>> > Example:
>> > https://github.com/rhierlmeier/vaadin8_karaf_demo/blob/main/src/main/feature/feature.xml
>> >
>> > You can find the configuration of the karaf maven plugin here:
>> > https://github.com/rhierlmeier/vaadin8_karaf_demo/blob/main/pom.xml
>> >
>> > This approach works, but is has the following disadvantages:
>> >
>> > *  You can not reuse feature version or version range properties with the 
>> > Maven BOM mechanism (import the dependency management).
>> > *  CI-system like Jenkins track build dependencies via Maven dependencies. 
>> > Jenkins will not trigger a build of a project when the parent feature 
>> > changes.
>> >
>> > Regards
>> >
>> >   Richard
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> > Am Mo., 8. Aug. 2022 um 11:49 Uhr schrieb Ephemeris Lappis 
>> > :
>> >>
>> >> Hello.
>> >>
>> >> I can't find any way to add dependent features to the feature I try to
>> >> generate using the maven plugin.
>> >>
>> >> The maven dependencies are added as expected with the matching bundles.
>> >>
>> >> How can I add features ? I've tried putting a feature.xml file in the
>> >> src/main/feature folder, but then the generation just copy this file
>> >> and do not update it...
>> >>
>> >> Thanks for your help.
>> >>
>> >> Regards.


Re: Karaf Maven Plugin / Depedent features

2022-08-08 Thread Richard Hierlmeier
Did you try the dependencyFeatures option:

I got this option with the following maven
mvn org.apache.maven.plugins:maven-help-plugin:3.2.0:describe
-Dcmd=org.apache.karaf.tooling:karaf-maven-plugin:features-generate-descriptor
-Ddetail
 ...
 dependencyFeatures
  Name of features which are dependencies (they still need to be defined
  separately).

Regards
   Richard

Am Mo., 8. Aug. 2022 um 14:03 Uhr schrieb Ephemeris Lappis <
ephemeris.lap...@gmail.com>:

> Hello.
>
> Thanks for your reply, Richard, but for now I'd prefer to use
> dependencies to create the features for our bundles, and rely on BOM
> version management.
>
> I've found a post talking about feature maven dependency declaration.
> In my case, for camel features, this should be something like that :
>
> 
> org.apache.camel.karaf
> apache-camel
> ${version.of.camel}
> features
> xml
> 
>
> This declaration perhaps should work, but has two drawbacks for now :
> - all the camel features that are in this feature repository are
> identified as features in mine : in my case I just want
> camel-blueprint and its transitive dependent features
> - none of them is marked as requirement :  prerequisite="false" dependency="false">camel-blueprint
>
> Another idea to go this way ;) ?
>
> Anyway to limit dependencies to individual features, and make them
> automatically installed by Karaf when installing our feature?
>
> Thanks again.
>
> Regards.
>
> Le lun. 8 août 2022 à 13:40, Richard Hierlmeier
>  a écrit :
> >
> > I have the same problem. I define feature dependencies in
> >
> > src/main/feature/features.xml
> >
> > For each feature dependency I have to define in the pom a version or
> version range property.
> >
> > Example:
> >
> https://github.com/rhierlmeier/vaadin8_karaf_demo/blob/main/src/main/feature/feature.xml
> >
> > You can find the configuration of the karaf maven plugin here:
> > https://github.com/rhierlmeier/vaadin8_karaf_demo/blob/main/pom.xml
> >
> > This approach works, but is has the following disadvantages:
> >
> > *  You can not reuse feature version or version range properties with
> the Maven BOM mechanism (import the dependency management).
> > *  CI-system like Jenkins track build dependencies via Maven
> dependencies. Jenkins will not trigger a build of a project when the parent
> feature changes.
> >
> > Regards
> >
> >   Richard
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > Am Mo., 8. Aug. 2022 um 11:49 Uhr schrieb Ephemeris Lappis <
> ephemeris.lap...@gmail.com>:
> >>
> >> Hello.
> >>
> >> I can't find any way to add dependent features to the feature I try to
> >> generate using the maven plugin.
> >>
> >> The maven dependencies are added as expected with the matching bundles.
> >>
> >> How can I add features ? I've tried putting a feature.xml file in the
> >> src/main/feature folder, but then the generation just copy this file
> >> and do not update it...
> >>
> >> Thanks for your help.
> >>
> >> Regards.
>


Re: Karaf Maven Plugin / Depedent features

2022-08-08 Thread Ephemeris Lappis
Hello.

Thanks for your reply, Richard, but for now I'd prefer to use
dependencies to create the features for our bundles, and rely on BOM
version management.

I've found a post talking about feature maven dependency declaration.
In my case, for camel features, this should be something like that :


org.apache.camel.karaf
apache-camel
${version.of.camel}
features
xml


This declaration perhaps should work, but has two drawbacks for now :
- all the camel features that are in this feature repository are
identified as features in mine : in my case I just want
camel-blueprint and its transitive dependent features
- none of them is marked as requirement : camel-blueprint

Another idea to go this way ;) ?

Anyway to limit dependencies to individual features, and make them
automatically installed by Karaf when installing our feature?

Thanks again.

Regards.

Le lun. 8 août 2022 à 13:40, Richard Hierlmeier
 a écrit :
>
> I have the same problem. I define feature dependencies in
>
> src/main/feature/features.xml
>
> For each feature dependency I have to define in the pom a version or version 
> range property.
>
> Example:
> https://github.com/rhierlmeier/vaadin8_karaf_demo/blob/main/src/main/feature/feature.xml
>
> You can find the configuration of the karaf maven plugin here:
> https://github.com/rhierlmeier/vaadin8_karaf_demo/blob/main/pom.xml
>
> This approach works, but is has the following disadvantages:
>
> *  You can not reuse feature version or version range properties with the 
> Maven BOM mechanism (import the dependency management).
> *  CI-system like Jenkins track build dependencies via Maven dependencies. 
> Jenkins will not trigger a build of a project when the parent feature changes.
>
> Regards
>
>   Richard
>
>
>
>
>
>
>
>
>
>
>
>
> Am Mo., 8. Aug. 2022 um 11:49 Uhr schrieb Ephemeris Lappis 
> :
>>
>> Hello.
>>
>> I can't find any way to add dependent features to the feature I try to
>> generate using the maven plugin.
>>
>> The maven dependencies are added as expected with the matching bundles.
>>
>> How can I add features ? I've tried putting a feature.xml file in the
>> src/main/feature folder, but then the generation just copy this file
>> and do not update it...
>>
>> Thanks for your help.
>>
>> Regards.


Re: Karaf Maven Plugin / Depedent features

2022-08-08 Thread Richard Hierlmeier
I have the same problem. I define feature dependencies in

src/main/feature/features.xml

For each feature dependency I have to define in the pom a version or
version range property.

Example:
https://github.com/rhierlmeier/vaadin8_karaf_demo/blob/main/src/main/feature/feature.xml

You can find the configuration of the karaf maven plugin here:
https://github.com/rhierlmeier/vaadin8_karaf_demo/blob/main/pom.xml

This approach works, but is has the following disadvantages:

*  You can not reuse feature version or version range properties with the
Maven BOM mechanism (import the dependency management).
*  CI-system like Jenkins track build dependencies via Maven dependencies.
Jenkins will not trigger a build of a project when the parent feature
changes.

Regards

  Richard












Am Mo., 8. Aug. 2022 um 11:49 Uhr schrieb Ephemeris Lappis <
ephemeris.lap...@gmail.com>:

> Hello.
>
> I can't find any way to add dependent features to the feature I try to
> generate using the maven plugin.
>
> The maven dependencies are added as expected with the matching bundles.
>
> How can I add features ? I've tried putting a feature.xml file in the
> src/main/feature folder, but then the generation just copy this file
> and do not update it...
>
> Thanks for your help.
>
> Regards.
>


Karaf Maven Plugin / Depedent features

2022-08-08 Thread Ephemeris Lappis
Hello.

I can't find any way to add dependent features to the feature I try to
generate using the maven plugin.

The maven dependencies are added as expected with the matching bundles.

How can I add features ? I've tried putting a feature.xml file in the
src/main/feature folder, but then the generation just copy this file
and do not update it...

Thanks for your help.

Regards.


Re: Problems with logging to karaf.log from liquibase >3

2022-08-08 Thread Steven Huypens
Hi Steinar,

As far as I can tell, there is a spifly-issue, which is why Liquibase
cannot create the correct Log Services. I tried


aries-proxy

mvn:org.apache.aries.spifly/org.apache.aries.spifly.dynamic.bundle/1.3.4

mvn:org.yaml/snakeyaml/${snakeyaml.version}

mvn:org.liquibase/liquibase-core/${liquibase.version}


which leads to new exceptions. The one from Liquibase Pro can be ignored
for now, I guess, and the other one might be related to your
ResourceAccessor, Good luck, I hope this helps you a little.

Kind regards,
Steven


On Sun, Aug 7, 2022 at 6:02 PM Steinar Bang  wrote:

> > Steven Huypens :
>
> > Hi Steinar,
> > I tried the liquibase-karaf-feature/use-liquibase-slf4j-410 branch. After
> > changing the liquibase version to 4.9.1 in the pom.xml, the build is
> > successful.
>
> Yes, but if you take a look at
>
>  
> liquibase-karaf-feature/liquibase-integration-test/karaf.liquibase.tests/target/exam//log/karaf.log
> you will see a stacktrace in the log, caused by "Cannot find default log
> service" and no liquibase logging from setting up the schema and
> populating it with data.
>  https://gist.github.com/steinarb/2857d60427d42686299b1d9a388ee420
>
> But if you switch to the master branch and change liquibase.version in
> .m2/settings.xml back to 3.8.0 and re-run "mvn clean install" you will
> find a
>
>  
> liquibase-karaf-feature/liquibase-integration-test/karaf.liquibase.tests/target/exam//log/karaf.log
> that doesn't have the "Cannot find default log service" error, and
> contains the log output from liquibase
>  https://gist.github.com/steinarb/d5902ae12bdcc1f96bd66eaf45f9311b
>
> This is the behaviour that has eluded me in all liquibase versions since
> 3.8.0(*), and the reason I haven't updated the liquibase version of the
> feature.
>
> But I've not given up yet! :-)
>
> (*) in 3.x versions >3.8.0 because of various OSGi and JDK 8 vs 11
> related problems, and in 4.x because the log system has changed and
> I haven't been able to make the liquibase logging work right with
> karaf
>
>


Karaf Maven Plugin / NoFileAssignedException

2022-08-08 Thread Ephemeris Lappis
Hello.

I'm trying to make a POC for refactoring old projects running today on
Red-Hat Fuse, and thus using its Fabric8's profile system for
deployment.

Karaf features seem to be a good alternative, but I have some issues
that are already reported about NoFileAssignedException on install
operations. I've found a workaround using an old install plugin. So I
have some questions...

Is there a fix of the Karaf plugin or some special configuration to
avoid using old install plugin versions ?

Do you know if the same issue will happen with deploy operations (not
tested yet with my POC) ?

Thanks in advance.

Regards.