[
https://issues.apache.org/jira/browse/KARAF-3547?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Mohammad Shamsi updated KARAF-3547:
-----------------------------------
Description:
Given following configuration in karaf-maven-plugin:
{code:xml}
<configuration>
<bootFeatures>
<feature>cxf</feature>
<feature>cxf-bean-validation</feature>
<feature>hibernate-validator</feature>
<feature>hibernate</feature>
</bootFeatures>
</configuration>
{code}
Sometimes, depnding on os and jdk, *cxf* or *hibernate* is NOT included in the
generated *featuresBoot* property in the *etc/org.apache.karaf.features.cfg*
file.
The root cause of the issue is in *InstallKarsMojo* which is simply using
*String.contains(String)* to find out if the feature is already added to the
list of boot features or not.
code snippet from *InstallKarsMojo.java* line 257:
{code:java}
if (!featuresBoot.contains(feature.getName())) {
featuresBoot = featuresBoot + feature.getName();
featuresProperties.put(FEATURES_BOOT, featuresBoot);
featuresProperties.save(featuresCfgFile);
}
{code}
Example:
Let's assume the *current featuresBoot* is "foo, *cxf-bean-validator*, bar"
and the new feature to include in boot features is "*cxf*",
then *featuresBoot.contains("cxf")* returns true and therefore cxf will NOT be
included in the final generated boot features.
was:
Given following configuration in karaf-maven-plugin:
{code:xml}
<configuration>
<bootFeatures>
<feature>cxf</feature>
<feature>cxf-bean-validation</feature>
<feature>hibernate-validator</feature>
<feature>hibernate</feature>
</bootFeatures>
</configuration>
</plugin>
{code}
Sometimes, depnding on os and jdk, *cxf* or *hibernate* is NOT included in the
generated *featuresBoot* property in the *etc/org.apache.karaf.features.cfg*
file.
The root cause of the issue is in *InstallKarsMojo* which is simply using
*String.contains(String)* to find out if the feature is already added to the
list of boot features or not.
code snippet from *InstallKarsMojo.java* line 257:
{code:java}
if (!featuresBoot.contains(feature.getName())) {
featuresBoot = featuresBoot + feature.getName();
featuresProperties.put(FEATURES_BOOT, featuresBoot);
featuresProperties.save(featuresCfgFile);
}
{code}
Example:
Let's assume the *current featuresBoot* is "foo, *cxf-bean-validator*, bar"
and the new feature to include in boot features is "*cxf*",
then *featuresBoot.contains("cxf")* returns true and therefore cxf will NOT be
included in the final generated boot features.
> InstallKarsMojo is ignoring some of the boot features that are added to
> plugin bootFeatures.
> ---------------------------------------------------------------------------------------------
>
> Key: KARAF-3547
> URL: https://issues.apache.org/jira/browse/KARAF-3547
> Project: Karaf
> Issue Type: Bug
> Components: karaf-tooling
> Affects Versions: 3.0.3
> Reporter: Mohammad Shamsi
>
> Given following configuration in karaf-maven-plugin:
> {code:xml}
> <configuration>
> <bootFeatures>
> <feature>cxf</feature>
> <feature>cxf-bean-validation</feature>
> <feature>hibernate-validator</feature>
> <feature>hibernate</feature>
> </bootFeatures>
> </configuration>
> {code}
> Sometimes, depnding on os and jdk, *cxf* or *hibernate* is NOT included in
> the generated *featuresBoot* property in the
> *etc/org.apache.karaf.features.cfg* file.
> The root cause of the issue is in *InstallKarsMojo* which is simply using
> *String.contains(String)* to find out if the feature is already added to the
> list of boot features or not.
> code snippet from *InstallKarsMojo.java* line 257:
> {code:java}
> if (!featuresBoot.contains(feature.getName())) {
> featuresBoot = featuresBoot + feature.getName();
> featuresProperties.put(FEATURES_BOOT, featuresBoot);
> featuresProperties.save(featuresCfgFile);
> }
> {code}
> Example:
> Let's assume the *current featuresBoot* is "foo, *cxf-bean-validator*, bar"
> and the new feature to include in boot features is "*cxf*",
> then *featuresBoot.contains("cxf")* returns true and therefore cxf will NOT
> be included in the final generated boot features.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)