Thanks JB, you gave me good hint. I think I know what’s going on. My project
imports dependency:
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-osgi-features</artifactId>
<classifier>features</classifier>
<type>xml</type>
<version>10.0.2</version>
</dependency>
But Keycloak features.xml file has:
<features xmlns="http://karaf.apache.org/xmlns/features/v1.0.0"
name="keycloak-${project.version}">
<feature name="keycloak-adapter-core" version="${project.version}"
resolver="(obr)">
Notice the namespace is v1.0.0, but the generated file has different namespace:
<features xmlns="http://karaf.apache.org/xmlns/features/v1.6.0"
name="deployment-keycloak-kar">
So I suppose the resolver attribute is no longer valid in version 1.6.0?
I would think the plugin should handle this scenario, as it is merging
different features with different versions.
How can I work around this problem?
Best regards,
Alex soto
> On Jun 4, 2020, at 12:49 PM, Alex Soto <[email protected]> wrote:
>
> I removed my src/main/feature/feature.xml file, so the file is being
> generated entirely by the plugin.
>
> <features xmlns="http://karaf.apache.org/xmlns/features/v1.6.0
> <http://karaf.apache.org/xmlns/features/v1.6.0>" name=“my-kar">
> <feature name="keycloak-adapter-core" resolver="(obr)" version="10.0.2”>
>
>
> Using version 4.2.8 of the plugin.
> So if the namespace is wrong, it is the plugin bug then.
>
> Best regards,
> Alex soto
>
>
>
>
>> On Jun 4, 2020, at 12:24 PM, Jean-Baptiste Onofré <[email protected]
>> <mailto:[email protected]>> wrote:
>>
>> Hi
>>
>> It depends of the plugin version and namespace version you are using.
>>
>> Let me update the default for 4.2.9.
>>
>> Regards
>> JB
>>
>> Le jeu. 4 juin 2020 ? 16:34, Alex Soto <[email protected]
>> <mailto:[email protected]>> a ?crit :
>> Hello,
>>
>> I am trying to create a KAR, but at run time I am getting an error:
>>
>> org.xml.sax.SAXParseException; cvc-complex-type.3.2.2: Attribute 'resolver'
>> is not allowed to appear in element 'feature?. I do not have attribute
>> ?resolver? in my features.xml file.
>>
>> My POM has:
>> <packaging>kar</packaging>
>>
>> <build>
>> <plugins>
>> <plugin>
>> <groupId>org.apache.karaf.tooling</groupId>
>> <artifactId>karaf-maven-plugin</artifactId>
>> <version>4.2.8</version>
>> <extensions>true</extensions>
>> <configuration>
>> <startLevel>80</startLevel>
>>
>> <aggregateFeatures>true</aggregateFeatures>
>>
>> <includeTransitiveDependency>true</includeTransitiveDependency>
>> <!-- <resolver>(obr)</resolver> -->
>>
>> <checkDependencyChange>true</checkDependencyChange>
>>
>> <failOnDependencyChange>false</failOnDependencyChange>
>>
>> <logDependencyChanges>true</logDependencyChanges>
>>
>> <overwriteChangedDependencies>true</overwriteChangedDependencies>
>> </configuration>
>> </plugin>
>> </plugins>
>> </build>
>>
>>
>> Also, I thought all dependencies would be added the the KAR archive under
>> the ?repository? folder, but this is not the case.
>>
>>
>> Best regards,
>> Alex soto
>>
>>
>>
>>
>