M. Gomes (Celfocus) created KARAF-7803:
------------------------------------------
Summary: It is not possible to use classpath configurations on
either boot or startup features when using the karaf-maven-plugin
Key: KARAF-7803
URL: https://issues.apache.org/jira/browse/KARAF-7803
Project: Karaf
Issue Type: Bug
Components: karaf
Affects Versions: 4.4.5
Environment: uname -a: Linux cinder 6.6.13-0-lts #1-Alpine SMP
PREEMPT_DYNAMIC Mon, 22 Jan 2024 23:34:43 +0000 x86_64 GNU/Linux
java version: openjdk version "17.0.10" 2024-01-16
maven: Apache Maven 3.9.6 (bc0240f3c744dd6b6ec2920b3cd08dcc295161ae)
Apache Karaf: 4.4.5
Reporter: M. Gomes (Celfocus)
Hello,
As far as I can tell from the documentation and from several tries the
karaf-maven-plugin is unable to correctly process karaf features that contain
configuration blocks with classpath URLs, i.e.:
{code:java}
<feature name="sling" version="${project.version}">
<config external="true"
name="org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended~sling-auth-core">classpath:org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended~sling-auth-core.cfg.json</config>
<!-- ... -->
</feature>
{code}
If the feature "sling" is either a boot or startup feature (or referenced from
one such feature) the build process always fails with this kind of message:
{noformat}
[ERROR] Failed to execute goal
org.apache.karaf.tooling:karaf-maven-plugin:4.4.5:assembly (default-assembly)
on project sling-overlays-distro: Unable to build assembly: Error:
[ERROR] Error downloading
classpath:org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended~sling-scripting.cfg.json
[ERROR] -> [Help 1]{noformat}
The only work around that works is to use config blocks with only felix cfg
notation as JSON blocks are not converted to JSON files correctly (i.e.
[https://github.com/apache/karaf/pull/1725/|https://github.com/apache/karaf/pull/1725]
does not appear to work correctly) and factory configurations when using the
new ~ notation appears also to be broken.
What am I doing wrong?
Best regards
PS: For reference just clone the Sling Karaf stuff:
* https://github.com/apache/sling-org-apache-sling-karaf-configs
* [https://github.com/apache/sling-org-apache-sling-karaf-features]
* [https://github.com/apache/sling-org-apache-sling-karaf-distribution]
And on the POM of this last one just move for example the sling feature from
installed to boot.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)