[Error] Karaf 4.0.8 Building feature with karaf-maven-plugin

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Error] Karaf 4.0.8 Building feature with karaf-maven-plugin

Koprowski, Mariusz
Hi
I'm trying to build my own feature that will combine ActiveMQ + some of my bundles but I'm stuck on generating a plugin that have pure ActiveMQ only
Here is my POM:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>features</artifactId>
        <groupId>com.my.esb</groupId>
        <version>1.0.0-SNAPSHOT</version>
    </parent>

    <!--
        Licensed to the Apache Software Foundation (ASF) under one or more
        contributor license agreements.  See the NOTICE file distributed with
        this work for additional information regarding copyright ownership.
        The ASF licenses this file to You under the Apache License, Version 2.0
        (the "License"); you may not use this file except in compliance with
        the License.  You may obtain a copy of the License at

            http://www.apache.org/licenses/LICENSE-2.0

        Unless required by applicable law or agreed to in writing, software
        distributed under the License is distributed on an "AS IS" BASIS,
        WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
        See the License for the specific language governing permissions and
        limitations under the License.
    -->

    <modelVersion>4.0.0</modelVersion>

    <groupId>com.my.esb.features</groupId>
    <artifactId>my-esb-amq</artifactId>
    <packaging>feature</packaging>

    <name>My ESB :: Feature :: AMQ</name>
    <description>Prepackaged AMQ Karaf feature, with no additional dependencies required.</description>

    <dependencies>
        <dependency>
            <groupId>org.apache.activemq</groupId>
            <artifactId>activemq-karaf</artifactId>
            <type>xml</type>
            <classifier>features</classifier>
        </dependency>
    </dependencies>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.karaf.tooling</groupId>
                    <artifactId>karaf-maven-plugin</artifactId>
                    <version>4.0.8</version>
                    <extensions>true</extensions>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.karaf.tooling</groupId>
                <artifactId>karaf-maven-plugin</artifactId>
                <version>${karaf.version}</version>
                <configuration>
                    <startLevel>50</startLevel>
                    <resolver>(orb)</resolver>
                    <aggregateFeatures>true</aggregateFeatures>
                    <checkDependencyChange>true</checkDependencyChange>
                    <failOnDependencyChange>false</failOnDependencyChange>
                    <logDependencyChanges>true</logDependencyChanges>
                    <overwriteChangedDependencies>true</overwriteChangedDependencies>
                </configuration>
                <executions>
                    <execution>
                        <id>features-add-to-repo</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>features-add-to-repository</goal>
                        </goals>
                        <configuration>
                            <descriptors>
                                <descriptor>mvn:org.apache.karaf.features/standard/${karaf.version}/xml/features</descriptor>                                
                                <descriptor>mvn:org.apache.activemq/activemq-karaf/${activemq.version}/xml/features</descriptor>
                                <descriptor>mvn:org.apache.activemq/activemq-karaf/${activemq.version}/xml/features-core</descriptor>
                                <descriptor>mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features</descriptor>
                            </descriptors>
                            <features>
                                <feature>activemq</feature>
                                <feature>activemq-cf</feature>
                                <feature>activemq-client</feature>
                                <feature>activemq-broker-noweb</feature>
                                <feature>ctivemq-camel</feature>
                                <feature>activemq-web-consol</feature>
                                <feature>activemq-blueprint</feature>
                                <feature>activemq-amqp-client</feature>
                                <feature>${project.artifactId}</feature>
                                <feature>${project.artifactId}-webconsole</feature>
                                <feature>${project.artifactId}-amqp</feature>
                            </features>
                            <repository>target</repository>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>

And here is a feature.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.3.0" name="${project.artifactId}">
    <repository>mvn:org.apache.activemq/activemq-karaf/${activemq.version}/xml/features-core</repository>
    <repository>mvn:org.apache.activemq/activemq-karaf/${activemq.version}/xml/features</repository>
    <!-- Apache ActiveMQ Features -->
    <feature name="activemq-broker-noweb" description="Full ActiveMQ broker with default configuration" start-level="50" hidden="true" version="${activemq.version}">
        <configfile finalname="/etc/activemq.xml">mvn:org.apache.activemq/activemq-karaf/${activemq.version}/xml/activemq</configfile>
        <configfile finalname="/etc/org.apache.activemq.server-default.cfg">mvn:org.apache.activemq/activemq-karaf/${activemq.version}/cfg/activemq</configfile>
        <feature version="${activemq.version}" prerequisite="false" dependency="true">activemq</feature>
    </feature>
    <feature name="activemq-camel" start-level="50" version="${activemq.version}" hidden="true">
        <feature version="${activemq.version}" prerequisite="false" dependency="true">activemq-client</feature>
        <feature version="[2.16,3)" prerequisite="false" dependency="true">camel-jms</feature>
        <feature version="[2.16,3)" prerequisite="false" dependency="true">camel</feature>
        <bundle>mvn:org.apache.activemq/activemq-camel/${activemq.version}</bundle>
    </feature>
    <feature name="activemq-web-console" start-level="50" hidden="true" version="${activemq.version}">
        <configfile finalname="/etc/org.apache.activemq.webconsole.cfg">mvn:org.apache.activemq/activemq-karaf/${activemq.version}/cfg/activemq-webconsole</configfile>
        <feature prerequisite="false" dependency="true">war</feature>
        <feature prerequisite="false" dependency="true">eventadmin</feature>
        <bundle>mvn:org.apache.activemq/activemq-web-console/${activemq.version}/war</bundle>
    </feature>
    <feature name="activemq-blueprint" start-level="50" hidden="true" version="${activemq.version}">
        <feature version="${activemq.version}" prerequisite="false" dependency="true">activemq</feature>
        <bundle dependency="true">mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.scripting-api-1.0/2.4.0</bundle>
        <bundle dependency="true">mvn:org.apache.commons/commons-jexl/2.0.1</bundle>
        <bundle dependency="true">mvn:org.apache.xbean/xbean-blueprint/4.2</bundle>
        <bundle>mvn:org.apache.activemq/activemq-blueprint/${activemq.version}</bundle>
    </feature>
    <feature name="activemq-amqp-client" description="ActiveMQ AMQP protocol client libraries" hidden="true" version="${activemq.version}">
        <bundle>mvn:io.netty/netty-common/4.0.41.Final</bundle>
        <bundle>mvn:io.netty/netty-transport/4.0.41.Final</bundle>
        <bundle>mvn:io.netty/netty-buffer/4.0.41.Final</bundle>
        <bundle>mvn:io.netty/netty-codec/4.0.41.Final</bundle>
        <bundle>mvn:io.netty/netty-codec-http/4.0.41.Final</bundle>
        <bundle>mvn:io.netty/netty-handler/4.0.41.Final</bundle>
        <bundle>mvn:org.apache.qpid/proton-j/0.14.0</bundle>
        <bundle>mvn:org.apache.qpid/qpid-jms-client/0.11.1</bundle>
    </feature>
    <!-- My ESB Features -->
    <feature name="${project.artifactId}" description=" AMQ with MQTT" version="${project.version}">
        <details>Hexagon Mining prepackaged AMQ Karaf feature, with no additional dependencies required.</details>
        <feature version="${activemq.version}" prerequisite="false" dependency="true">activemq-broker-noweb</feature>
        <feature version="${activemq.version}" prerequisite="false" dependency="true">activemq-camel</feature>
        <feature version="${activemq.version}" prerequisite="false" dependency="true">activemq-blueprint</feature>
    </feature>
    <feature name="${project.artifactId}-amqp" description=" AMQ AMQP Client" version="${project.version}">
        <details>Hexagon Mining prepackaged AMQ Karaf feature, with no additional dependencies required.</details>
        <feature version="${project.version}" prerequisite="false" dependency="true">${project.artifactId}</feature>
        <feature version="${activemq.version}" prerequisite="false" dependency="true">activemq-amqp-client</feature>
    </feature>
    <feature name="${project.artifactId}-webconsole" description=" AMQ Standalone WebConsole" version="${project.version}">
        <details>Hexagon Mining prepackaged AMQ Karaf feature, with no additional dependencies required.</details>
        <feature version="${project.version}" prerequisite="false" dependency="true">${project.artifactId}</feature>
        <feature version="${activemq.version}" prerequisite="false" dependency="true">activemq-web-console</feature>
    </feature>

</features>


When I'm trying to run Karaf: features-add-to-repository
I'm getting fallowing error:
[ERROR] Failed to execute goal org.apache.karaf.tooling:karaf-maven-plugin:4.0.8:features-add-to-repository (default-cli) on project my-esb-amq -amq: Error populating repository: NullPointerException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.karaf.tooling:karaf-maven-plugin:4.0.8:features-add-to-repository (default-cli) on project my-esb-amq -amq: Error populating repository
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:47)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error populating repository
        at org.apache.karaf.tooling.features.AbstractFeatureMojo.resolveFeatures(AbstractFeatureMojo.java:267)
        at org.apache.karaf.tooling.features.AddToRepositoryMojo.execute(AddToRepositoryMojo.java:58)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
        ... 21 more
Caused by: java.lang.NullPointerException
        at org.apache.karaf.tooling.features.AbstractFeatureMojo.resolveFeatures(AbstractFeatureMojo.java:235)
        ... 24 more
[ERROR]
[ERROR]

When I'm trying to run mvn install I get fallowing error:
ERROR] Failed to execute goal org.apache.karaf.tooling:karaf-maven-plugin:4.0.8:features-add-to-repository (features-add-to-repo) on project my-esb-amq: Error populating repository: Unable to validate file:///C:/Users/mkoprows/.m2/repository/org/apache/activemq/activemq-karaf/5.14.3/activemq-karaf-5.14.3-features.xml: cvc-complex-type.3.2.2: Attribute 'start-level' is not allowed to appear in element 'feature'. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.karaf.tooling:karaf-maven-plugin:4.0.8:features-add-to-repository (features-add-to-repo) on project my-esb-amq: Error populating repository
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:47)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error populating repository
        at org.apache.karaf.tooling.features.AbstractFeatureMojo.resolveFeatures(AbstractFeatureMojo.java:267)
        at org.apache.karaf.tooling.features.AddToRepositoryMojo.execute(AddToRepositoryMojo.java:58)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
        ... 21 more
Caused by: java.lang.IllegalArgumentException: Unable to validate file:///C:/Users/mkoprows/.m2/repository/org/apache/activemq/activemq-karaf/5.14.3/activemq-karaf-5.14.3-features.xml
        at org.apache.karaf.features.internal.model.JaxbUtil.unmarshalValidate(JaxbUtil.java:127)
        at org.apache.karaf.features.internal.model.JaxbUtil.unmarshal(JaxbUtil.java:101)
        at org.apache.karaf.features.internal.model.JaxbUtil.unmarshal(JaxbUtil.java:95)
        at org.apache.karaf.tooling.features.AbstractFeatureMojo.retrieveDescriptorsRecursively(AbstractFeatureMojo.java:125)
        at org.apache.karaf.tooling.features.AbstractFeatureMojo.resolveFeatures(AbstractFeatureMojo.java:236)
        ... 24 more
Caused by: org.xml.sax.SAXParseException; cvc-complex-type.3.2.2: Attribute 'start-level' is not allowed to appear in element 'feature'.
        at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)
        at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134)
        at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:396)
        at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327)
        at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:284)
        at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:452)
        at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3230)
        at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processAttributes(XMLSchemaValidator.java:2707)
        at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:2050)
        at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:740)
        at com.sun.org.apache.xerces.internal.jaxp.validation.DOMValidatorHelper.beginNode(DOMValidatorHelper.java:277)
        at com.sun.org.apache.xerces.internal.jaxp.validation.DOMValidatorHelper.validate(DOMValidatorHelper.java:244)
        at com.sun.org.apache.xerces.internal.jaxp.validation.DOMValidatorHelper.validate(DOMValidatorHelper.java:190)
        at com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorImpl.validate(ValidatorImpl.java:109)
        at javax.xml.validation.Validator.validate(Validator.java:124)
        at org.apache.karaf.features.internal.model.JaxbUtil.unmarshalValidate(JaxbUtil.java:125)
        ... 28 more
[ERROR]
[ERROR]

I'm using Java 1.8.0 and tested the results on Maven 3.0.0 and 3.5.0

Best regards
--
Mariusz Koprowski

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Error] Karaf 4.0.8 Building feature with karaf-maven-plugin

jbonofre
Hi,

It seems your features XML contains start-level in a feature, right ?

Regards
JB

On 04/20/2017 04:40 PM, Koprowski, Mariusz wrote:

> Hi
> I'm trying to build my own feature that will combine ActiveMQ + some of my bundles but I'm stuck on generating a plugin that have pure ActiveMQ only
> Here is my POM:
> <?xml version="1.0" encoding="UTF-8"?>
> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
>     <parent>
>         <artifactId>features</artifactId>
>         <groupId>com.my.esb</groupId>
>         <version>1.0.0-SNAPSHOT</version>
>     </parent>
>
>     <!--
>         Licensed to the Apache Software Foundation (ASF) under one or more
>         contributor license agreements.  See the NOTICE file distributed with
>         this work for additional information regarding copyright ownership.
>         The ASF licenses this file to You under the Apache License, Version 2.0
>         (the "License"); you may not use this file except in compliance with
>         the License.  You may obtain a copy of the License at
>
>             http://www.apache.org/licenses/LICENSE-2.0
>
>         Unless required by applicable law or agreed to in writing, software
>         distributed under the License is distributed on an "AS IS" BASIS,
>         WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
>         See the License for the specific language governing permissions and
>         limitations under the License.
>     -->
>
>     <modelVersion>4.0.0</modelVersion>
>
>     <groupId>com.my.esb.features</groupId>
>     <artifactId>my-esb-amq</artifactId>
>     <packaging>feature</packaging>
>
>     <name>My ESB :: Feature :: AMQ</name>
>     <description>Prepackaged AMQ Karaf feature, with no additional dependencies required.</description>
>
>     <dependencies>
>         <dependency>
>             <groupId>org.apache.activemq</groupId>
>             <artifactId>activemq-karaf</artifactId>
>             <type>xml</type>
>             <classifier>features</classifier>
>         </dependency>
>     </dependencies>
>
>     <build>
>         <pluginManagement>
>             <plugins>
>                 <plugin>
>                     <groupId>org.apache.karaf.tooling</groupId>
>                     <artifactId>karaf-maven-plugin</artifactId>
>                     <version>4.0.8</version>
>                     <extensions>true</extensions>
>                 </plugin>
>             </plugins>
>         </pluginManagement>
>         <plugins>
>             <plugin>
>                 <groupId>org.apache.karaf.tooling</groupId>
>                 <artifactId>karaf-maven-plugin</artifactId>
>                 <version>${karaf.version}</version>
>                 <configuration>
>                     <startLevel>50</startLevel>
>                     <resolver>(orb)</resolver>
>                     <aggregateFeatures>true</aggregateFeatures>
>                     <checkDependencyChange>true</checkDependencyChange>
>                     <failOnDependencyChange>false</failOnDependencyChange>
>                     <logDependencyChanges>true</logDependencyChanges>
>                     <overwriteChangedDependencies>true</overwriteChangedDependencies>
>                 </configuration>
>                 <executions>
>                     <execution>
>                         <id>features-add-to-repo</id>
>                         <phase>generate-resources</phase>
>                         <goals>
>                             <goal>features-add-to-repository</goal>
>                         </goals>
>                         <configuration>
>                             <descriptors>
>                                 <descriptor>mvn:org.apache.karaf.features/standard/${karaf.version}/xml/features</descriptor>
>                                 <descriptor>mvn:org.apache.activemq/activemq-karaf/${activemq.version}/xml/features</descriptor>
>                                 <descriptor>mvn:org.apache.activemq/activemq-karaf/${activemq.version}/xml/features-core</descriptor>
>                                 <descriptor>mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features</descriptor>
>                             </descriptors>
>                             <features>
>                                 <feature>activemq</feature>
>                                 <feature>activemq-cf</feature>
>                                 <feature>activemq-client</feature>
>                                 <feature>activemq-broker-noweb</feature>
>                                 <feature>ctivemq-camel</feature>
>                                 <feature>activemq-web-consol</feature>
>                                 <feature>activemq-blueprint</feature>
>                                 <feature>activemq-amqp-client</feature>
>                                 <feature>${project.artifactId}</feature>
>                                 <feature>${project.artifactId}-webconsole</feature>
>                                 <feature>${project.artifactId}-amqp</feature>
>                             </features>
>                             <repository>target</repository>
>                         </configuration>
>                     </execution>
>                 </executions>
>             </plugin>
>         </plugins>
>     </build>
>
> </project>
>
> And here is a feature.xml
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> <features xmlns="http://karaf.apache.org/xmlns/features/v1.3.0" name="${project.artifactId}">
>     <repository>mvn:org.apache.activemq/activemq-karaf/${activemq.version}/xml/features-core</repository>
>     <repository>mvn:org.apache.activemq/activemq-karaf/${activemq.version}/xml/features</repository>
>     <!-- Apache ActiveMQ Features -->
>     <feature name="activemq-broker-noweb" description="Full ActiveMQ broker with default configuration" start-level="50" hidden="true" version="${activemq.version}">
>         <configfile finalname="/etc/activemq.xml">mvn:org.apache.activemq/activemq-karaf/${activemq.version}/xml/activemq</configfile>
>         <configfile finalname="/etc/org.apache.activemq.server-default.cfg">mvn:org.apache.activemq/activemq-karaf/${activemq.version}/cfg/activemq</configfile>
>         <feature version="${activemq.version}" prerequisite="false" dependency="true">activemq</feature>
>     </feature>
>     <feature name="activemq-camel" start-level="50" version="${activemq.version}" hidden="true">
>         <feature version="${activemq.version}" prerequisite="false" dependency="true">activemq-client</feature>
>         <feature version="[2.16,3)" prerequisite="false" dependency="true">camel-jms</feature>
>         <feature version="[2.16,3)" prerequisite="false" dependency="true">camel</feature>
>         <bundle>mvn:org.apache.activemq/activemq-camel/${activemq.version}</bundle>
>     </feature>
>     <feature name="activemq-web-console" start-level="50" hidden="true" version="${activemq.version}">
>         <configfile finalname="/etc/org.apache.activemq.webconsole.cfg">mvn:org.apache.activemq/activemq-karaf/${activemq.version}/cfg/activemq-webconsole</configfile>
>         <feature prerequisite="false" dependency="true">war</feature>
>         <feature prerequisite="false" dependency="true">eventadmin</feature>
>         <bundle>mvn:org.apache.activemq/activemq-web-console/${activemq.version}/war</bundle>
>     </feature>
>     <feature name="activemq-blueprint" start-level="50" hidden="true" version="${activemq.version}">
>         <feature version="${activemq.version}" prerequisite="false" dependency="true">activemq</feature>
>         <bundle dependency="true">mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.scripting-api-1.0/2.4.0</bundle>
>         <bundle dependency="true">mvn:org.apache.commons/commons-jexl/2.0.1</bundle>
>         <bundle dependency="true">mvn:org.apache.xbean/xbean-blueprint/4.2</bundle>
>         <bundle>mvn:org.apache.activemq/activemq-blueprint/${activemq.version}</bundle>
>     </feature>
>     <feature name="activemq-amqp-client" description="ActiveMQ AMQP protocol client libraries" hidden="true" version="${activemq.version}">
>         <bundle>mvn:io.netty/netty-common/4.0.41.Final</bundle>
>         <bundle>mvn:io.netty/netty-transport/4.0.41.Final</bundle>
>         <bundle>mvn:io.netty/netty-buffer/4.0.41.Final</bundle>
>         <bundle>mvn:io.netty/netty-codec/4.0.41.Final</bundle>
>         <bundle>mvn:io.netty/netty-codec-http/4.0.41.Final</bundle>
>         <bundle>mvn:io.netty/netty-handler/4.0.41.Final</bundle>
>         <bundle>mvn:org.apache.qpid/proton-j/0.14.0</bundle>
>         <bundle>mvn:org.apache.qpid/qpid-jms-client/0.11.1</bundle>
>     </feature>
>     <!-- My ESB Features -->
>     <feature name="${project.artifactId}" description=" AMQ with MQTT" version="${project.version}">
>         <details>Hexagon Mining prepackaged AMQ Karaf feature, with no additional dependencies required.</details>
>         <feature version="${activemq.version}" prerequisite="false" dependency="true">activemq-broker-noweb</feature>
>         <feature version="${activemq.version}" prerequisite="false" dependency="true">activemq-camel</feature>
>         <feature version="${activemq.version}" prerequisite="false" dependency="true">activemq-blueprint</feature>
>     </feature>
>     <feature name="${project.artifactId}-amqp" description=" AMQ AMQP Client" version="${project.version}">
>         <details>Hexagon Mining prepackaged AMQ Karaf feature, with no additional dependencies required.</details>
>         <feature version="${project.version}" prerequisite="false" dependency="true">${project.artifactId}</feature>
>         <feature version="${activemq.version}" prerequisite="false" dependency="true">activemq-amqp-client</feature>
>     </feature>
>     <feature name="${project.artifactId}-webconsole" description=" AMQ Standalone WebConsole" version="${project.version}">
>         <details>Hexagon Mining prepackaged AMQ Karaf feature, with no additional dependencies required.</details>
>         <feature version="${project.version}" prerequisite="false" dependency="true">${project.artifactId}</feature>
>         <feature version="${activemq.version}" prerequisite="false" dependency="true">activemq-web-console</feature>
>     </feature>
>
> </features>
>
>
> When I'm trying to run Karaf: features-add-to-repository
> I'm getting fallowing error:
> [ERROR] Failed to execute goal org.apache.karaf.tooling:karaf-maven-plugin:4.0.8:features-add-to-repository (default-cli) on project my-esb-amq -amq: Error populating repository: NullPointerException -> [Help 1]
> org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.karaf.tooling:karaf-maven-plugin:4.0.8:features-add-to-repository (default-cli) on project my-esb-amq -amq: Error populating repository
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
> at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
> at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
> at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
> at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
> at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
> at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
> at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
> at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
> at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
> at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
> at org.codehaus.classworlds.Launcher.main(Launcher.java:47)
> Caused by: org.apache.maven.plugin.MojoExecutionException: Error populating repository
> at org.apache.karaf.tooling.features.AbstractFeatureMojo.resolveFeatures(AbstractFeatureMojo.java:267)
> at org.apache.karaf.tooling.features.AddToRepositoryMojo.execute(AddToRepositoryMojo.java:58)
> at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
> ... 21 more
> Caused by: java.lang.NullPointerException
> at org.apache.karaf.tooling.features.AbstractFeatureMojo.resolveFeatures(AbstractFeatureMojo.java:235)
> ... 24 more
> [ERROR]
> [ERROR]
>
> When I'm trying to run mvn install I get fallowing error:
> ERROR] Failed to execute goal org.apache.karaf.tooling:karaf-maven-plugin:4.0.8:features-add-to-repository (features-add-to-repo) on project my-esb-amq: Error populating repository: Unable to validate file:///C:/Users/mkoprows/.m2/repository/org/apache/activemq/activemq-karaf/5.14.3/activemq-karaf-5.14.3-features.xml: cvc-complex-type.3.2.2: Attribute 'start-level' is not allowed to appear in element 'feature'. -> [Help 1]
> org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.karaf.tooling:karaf-maven-plugin:4.0.8:features-add-to-repository (features-add-to-repo) on project my-esb-amq: Error populating repository
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
> at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
> at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
> at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
> at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
> at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
> at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
> at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
> at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
> at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
> at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
> at org.codehaus.classworlds.Launcher.main(Launcher.java:47)
> Caused by: org.apache.maven.plugin.MojoExecutionException: Error populating repository
> at org.apache.karaf.tooling.features.AbstractFeatureMojo.resolveFeatures(AbstractFeatureMojo.java:267)
> at org.apache.karaf.tooling.features.AddToRepositoryMojo.execute(AddToRepositoryMojo.java:58)
> at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
> ... 21 more
> Caused by: java.lang.IllegalArgumentException: Unable to validate file:///C:/Users/mkoprows/.m2/repository/org/apache/activemq/activemq-karaf/5.14.3/activemq-karaf-5.14.3-features.xml
> at org.apache.karaf.features.internal.model.JaxbUtil.unmarshalValidate(JaxbUtil.java:127)
> at org.apache.karaf.features.internal.model.JaxbUtil.unmarshal(JaxbUtil.java:101)
> at org.apache.karaf.features.internal.model.JaxbUtil.unmarshal(JaxbUtil.java:95)
> at org.apache.karaf.tooling.features.AbstractFeatureMojo.retrieveDescriptorsRecursively(AbstractFeatureMojo.java:125)
> at org.apache.karaf.tooling.features.AbstractFeatureMojo.resolveFeatures(AbstractFeatureMojo.java:236)
> ... 24 more
> Caused by: org.xml.sax.SAXParseException; cvc-complex-type.3.2.2: Attribute 'start-level' is not allowed to appear in element 'feature'.
> at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)
> at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134)
> at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:396)
> at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327)
> at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:284)
> at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:452)
> at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3230)
> at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processAttributes(XMLSchemaValidator.java:2707)
> at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:2050)
> at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:740)
> at com.sun.org.apache.xerces.internal.jaxp.validation.DOMValidatorHelper.beginNode(DOMValidatorHelper.java:277)
> at com.sun.org.apache.xerces.internal.jaxp.validation.DOMValidatorHelper.validate(DOMValidatorHelper.java:244)
> at com.sun.org.apache.xerces.internal.jaxp.validation.DOMValidatorHelper.validate(DOMValidatorHelper.java:190)
> at com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorImpl.validate(ValidatorImpl.java:109)
> at javax.xml.validation.Validator.validate(Validator.java:124)
> at org.apache.karaf.features.internal.model.JaxbUtil.unmarshalValidate(JaxbUtil.java:125)
> ... 28 more
> [ERROR]
> [ERROR]
>
> I'm using Java 1.8.0 and tested the results on Maven 3.0.0 and 3.5.0
>
> Best regards
> --
> Mariusz Koprowski
>

--
Jean-Baptiste Onofré
[hidden email]
http://blog.nanthrax.net
Talend - http://www.talend.com
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

ODP: [Error] Karaf 4.0.8 Building feature with karaf-maven-plugin

Koprowski, Mariusz
Hi,
Well I do... but for test I have remove them.

But the problem is not my features it's a problem with original Apache ActiveMQ Karaf that is imported by karaf plugin.
.m2/repository/org/apache/activemq/activemq-karaf/5.14.3/activemq-karaf-5.14.3-features.xml: cvc-complex-type.3.2.2: Attribute 'start-level' is not allowed to appear in element 'feature'

Best regards
--
Mariusz Koprowski
Enterprise Solutions Engineering Lead
T: +48 42 253 48 28
E: [hidden email]
Hexagon Mining
Wolczanska 128/134
90-441, Lodz, Poland
www.hexagonmining.com | WebEx | Skype

-----Wiadomość oryginalna-----
Od: Jean-Baptiste Onofré [mailto:[hidden email]]
Wysłano: Thursday, April 20, 2017 4:51 PM
Do: [hidden email]
Temat: Re: [Error] Karaf 4.0.8 Building feature with karaf-maven-plugin

Hi,

It seems your features XML contains start-level in a feature, right ?

Regards
JB

On 04/20/2017 04:40 PM, Koprowski, Mariusz wrote:

> Hi
> I'm trying to build my own feature that will combine ActiveMQ + some
> of my bundles but I'm stuck on generating a plugin that have pure ActiveMQ only Here is my POM:
> <?xml version="1.0" encoding="UTF-8"?> <project
> xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
>     <parent>
>         <artifactId>features</artifactId>
>         <groupId>com.my.esb</groupId>
>         <version>1.0.0-SNAPSHOT</version>
>     </parent>
>
>     <!--
>         Licensed to the Apache Software Foundation (ASF) under one or more
>         contributor license agreements.  See the NOTICE file distributed with
>         this work for additional information regarding copyright ownership.
>         The ASF licenses this file to You under the Apache License, Version 2.0
>         (the "License"); you may not use this file except in compliance with
>         the License.  You may obtain a copy of the License at
>
>             http://www.apache.org/licenses/LICENSE-2.0
>
>         Unless required by applicable law or agreed to in writing, software
>         distributed under the License is distributed on an "AS IS" BASIS,
>         WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
>         See the License for the specific language governing permissions and
>         limitations under the License.
>     -->
>
>     <modelVersion>4.0.0</modelVersion>
>
>     <groupId>com.my.esb.features</groupId>
>     <artifactId>my-esb-amq</artifactId>
>     <packaging>feature</packaging>
>
>     <name>My ESB :: Feature :: AMQ</name>
>     <description>Prepackaged AMQ Karaf feature, with no additional
> dependencies required.</description>
>
>     <dependencies>
>         <dependency>
>             <groupId>org.apache.activemq</groupId>
>             <artifactId>activemq-karaf</artifactId>
>             <type>xml</type>
>             <classifier>features</classifier>
>         </dependency>
>     </dependencies>
>
>     <build>
>         <pluginManagement>
>             <plugins>
>                 <plugin>
>                     <groupId>org.apache.karaf.tooling</groupId>
>                     <artifactId>karaf-maven-plugin</artifactId>
>                     <version>4.0.8</version>
>                     <extensions>true</extensions>
>                 </plugin>
>             </plugins>
>         </pluginManagement>
>         <plugins>
>             <plugin>
>                 <groupId>org.apache.karaf.tooling</groupId>
>                 <artifactId>karaf-maven-plugin</artifactId>
>                 <version>${karaf.version}</version>
>                 <configuration>
>                     <startLevel>50</startLevel>
>                     <resolver>(orb)</resolver>
>                     <aggregateFeatures>true</aggregateFeatures>
>                     <checkDependencyChange>true</checkDependencyChange>
>                     <failOnDependencyChange>false</failOnDependencyChange>
>                     <logDependencyChanges>true</logDependencyChanges>
>                     <overwriteChangedDependencies>true</overwriteChangedDependencies>
>                 </configuration>
>                 <executions>
>                     <execution>
>                         <id>features-add-to-repo</id>
>                         <phase>generate-resources</phase>
>                         <goals>
>                             <goal>features-add-to-repository</goal>
>                         </goals>
>                         <configuration>
>                             <descriptors>
>                                 <descriptor>mvn:org.apache.karaf.features/standard/${karaf.version}/xml/features</descriptor>
>                                 <descriptor>mvn:org.apache.activemq/activemq-karaf/${activemq.version}/xml/features</descriptor>
>                                 <descriptor>mvn:org.apache.activemq/activemq-karaf/${activemq.version}/xml/features-core</descriptor>
>                                 <descriptor>mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features</descriptor>
>                             </descriptors>
>                             <features>
>                                 <feature>activemq</feature>
>                                 <feature>activemq-cf</feature>
>                                 <feature>activemq-client</feature>
>                                 <feature>activemq-broker-noweb</feature>
>                                 <feature>ctivemq-camel</feature>
>                                 <feature>activemq-web-consol</feature>
>                                 <feature>activemq-blueprint</feature>
>                                 <feature>activemq-amqp-client</feature>
>                                 <feature>${project.artifactId}</feature>
>                                 <feature>${project.artifactId}-webconsole</feature>
>                                 <feature>${project.artifactId}-amqp</feature>
>                             </features>
>                             <repository>target</repository>
>                         </configuration>
>                     </execution>
>                 </executions>
>             </plugin>
>         </plugins>
>     </build>
>
> </project>
>
> And here is a feature.xml
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <features
> xmlns="http://karaf.apache.org/xmlns/features/v1.3.0" name="${project.artifactId}">
>     <repository>mvn:org.apache.activemq/activemq-karaf/${activemq.version}/xml/features-core</repository>
>     <repository>mvn:org.apache.activemq/activemq-karaf/${activemq.version}/xml/features</repository>
>     <!-- Apache ActiveMQ Features -->
>     <feature name="activemq-broker-noweb" description="Full ActiveMQ broker with default configuration" start-level="50" hidden="true" version="${activemq.version}">
>         <configfile finalname="/etc/activemq.xml">mvn:org.apache.activemq/activemq-karaf/${activemq.version}/xml/activemq</configfile>
>         <configfile finalname="/etc/org.apache.activemq.server-default.cfg">mvn:org.apache.activemq/activemq-karaf/${activemq.version}/cfg/activemq</configfile>
>         <feature version="${activemq.version}" prerequisite="false" dependency="true">activemq</feature>
>     </feature>
>     <feature name="activemq-camel" start-level="50" version="${activemq.version}" hidden="true">
>         <feature version="${activemq.version}" prerequisite="false" dependency="true">activemq-client</feature>
>         <feature version="[2.16,3)" prerequisite="false" dependency="true">camel-jms</feature>
>         <feature version="[2.16,3)" prerequisite="false" dependency="true">camel</feature>
>         <bundle>mvn:org.apache.activemq/activemq-camel/${activemq.version}</bundle>
>     </feature>
>     <feature name="activemq-web-console" start-level="50" hidden="true" version="${activemq.version}">
>         <configfile finalname="/etc/org.apache.activemq.webconsole.cfg">mvn:org.apache.activemq/activemq-karaf/${activemq.version}/cfg/activemq-webconsole</configfile>
>         <feature prerequisite="false" dependency="true">war</feature>
>         <feature prerequisite="false" dependency="true">eventadmin</feature>
>         <bundle>mvn:org.apache.activemq/activemq-web-console/${activemq.version}/war</bundle>
>     </feature>
>     <feature name="activemq-blueprint" start-level="50" hidden="true" version="${activemq.version}">
>         <feature version="${activemq.version}" prerequisite="false" dependency="true">activemq</feature>
>         <bundle dependency="true">mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.scripting-api-1.0/2.4.0</bundle>
>         <bundle dependency="true">mvn:org.apache.commons/commons-jexl/2.0.1</bundle>
>         <bundle dependency="true">mvn:org.apache.xbean/xbean-blueprint/4.2</bundle>
>         <bundle>mvn:org.apache.activemq/activemq-blueprint/${activemq.version}</bundle>
>     </feature>
>     <feature name="activemq-amqp-client" description="ActiveMQ AMQP protocol client libraries" hidden="true" version="${activemq.version}">
>         <bundle>mvn:io.netty/netty-common/4.0.41.Final</bundle>
>         <bundle>mvn:io.netty/netty-transport/4.0.41.Final</bundle>
>         <bundle>mvn:io.netty/netty-buffer/4.0.41.Final</bundle>
>         <bundle>mvn:io.netty/netty-codec/4.0.41.Final</bundle>
>         <bundle>mvn:io.netty/netty-codec-http/4.0.41.Final</bundle>
>         <bundle>mvn:io.netty/netty-handler/4.0.41.Final</bundle>
>         <bundle>mvn:org.apache.qpid/proton-j/0.14.0</bundle>
>         <bundle>mvn:org.apache.qpid/qpid-jms-client/0.11.1</bundle>
>     </feature>
>     <!-- My ESB Features -->
>     <feature name="${project.artifactId}" description=" AMQ with MQTT" version="${project.version}">
>         <details>Hexagon Mining prepackaged AMQ Karaf feature, with no additional dependencies required.</details>
>         <feature version="${activemq.version}" prerequisite="false" dependency="true">activemq-broker-noweb</feature>
>         <feature version="${activemq.version}" prerequisite="false" dependency="true">activemq-camel</feature>
>         <feature version="${activemq.version}" prerequisite="false" dependency="true">activemq-blueprint</feature>
>     </feature>
>     <feature name="${project.artifactId}-amqp" description=" AMQ AMQP Client" version="${project.version}">
>         <details>Hexagon Mining prepackaged AMQ Karaf feature, with no additional dependencies required.</details>
>         <feature version="${project.version}" prerequisite="false" dependency="true">${project.artifactId}</feature>
>         <feature version="${activemq.version}" prerequisite="false" dependency="true">activemq-amqp-client</feature>
>     </feature>
>     <feature name="${project.artifactId}-webconsole" description=" AMQ Standalone WebConsole" version="${project.version}">
>         <details>Hexagon Mining prepackaged AMQ Karaf feature, with no additional dependencies required.</details>
>         <feature version="${project.version}" prerequisite="false" dependency="true">${project.artifactId}</feature>
>         <feature version="${activemq.version}" prerequisite="false" dependency="true">activemq-web-console</feature>
>     </feature>
>
> </features>
>
>
> When I'm trying to run Karaf: features-add-to-repository I'm getting
> fallowing error:
> [ERROR] Failed to execute goal
> org.apache.karaf.tooling:karaf-maven-plugin:4.0.8:features-add-to-repo
> sitory (default-cli) on project my-esb-amq -amq: Error populating
> repository: NullPointerException -> [Help 1]
> org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.karaf.tooling:karaf-maven-plugin:4.0.8:features-add-to-repository (default-cli) on project my-esb-amq -amq: Error populating repository
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
> at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
> at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
> at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
> at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
> at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
> at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
> at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
> at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
> at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
> at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
> at org.codehaus.classworlds.Launcher.main(Launcher.java:47)
> Caused by: org.apache.maven.plugin.MojoExecutionException: Error populating repository
> at org.apache.karaf.tooling.features.AbstractFeatureMojo.resolveFeatures(AbstractFeatureMojo.java:267)
> at org.apache.karaf.tooling.features.AddToRepositoryMojo.execute(AddToRepositoryMojo.java:58)
> at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
> ... 21 more
> Caused by: java.lang.NullPointerException
> at org.apache.karaf.tooling.features.AbstractFeatureMojo.resolveFeatures(AbstractFeatureMojo.java:235)
> ... 24 more
> [ERROR]
> [ERROR]
>
> When I'm trying to run mvn install I get fallowing error:
> ERROR] Failed to execute goal
> org.apache.karaf.tooling:karaf-maven-plugin:4.0.8:features-add-to-repo
> sitory (features-add-to-repo) on project my-esb-amq: Error populating
> repository: Unable to validate
> file:///C:/Users/mkoprows/.m2/repository/org/apache/activemq/activemq-
> karaf/5.14.3/activemq-karaf-5.14.3-features.xml:
> cvc-complex-type.3.2.2: Attribute 'start-level' is not allowed to
> appear in element 'feature'. -> [Help 1]
> org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.karaf.tooling:karaf-maven-plugin:4.0.8:features-add-to-repository (features-add-to-repo) on project my-esb-amq: Error populating repository
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
> at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
> at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
> at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
> at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
> at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
> at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
> at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
> at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
> at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
> at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
> at org.codehaus.classworlds.Launcher.main(Launcher.java:47)
> Caused by: org.apache.maven.plugin.MojoExecutionException: Error populating repository
> at org.apache.karaf.tooling.features.AbstractFeatureMojo.resolveFeatures(AbstractFeatureMojo.java:267)
> at org.apache.karaf.tooling.features.AddToRepositoryMojo.execute(AddToRepositoryMojo.java:58)
> at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
> ... 21 more
> Caused by: java.lang.IllegalArgumentException: Unable to validate file:///C:/Users/mkoprows/.m2/repository/org/apache/activemq/activemq-karaf/5.14.3/activemq-karaf-5.14.3-features.xml
> at org.apache.karaf.features.internal.model.JaxbUtil.unmarshalValidate(JaxbUtil.java:127)
> at org.apache.karaf.features.internal.model.JaxbUtil.unmarshal(JaxbUtil.java:101)
> at org.apache.karaf.features.internal.model.JaxbUtil.unmarshal(JaxbUtil.java:95)
> at org.apache.karaf.tooling.features.AbstractFeatureMojo.retrieveDescriptorsRecursively(AbstractFeatureMojo.java:125)
> at org.apache.karaf.tooling.features.AbstractFeatureMojo.resolveFeatures(AbstractFeatureMojo.java:236)
> ... 24 more
> Caused by: org.xml.sax.SAXParseException; cvc-complex-type.3.2.2: Attribute 'start-level' is not allowed to appear in element 'feature'.
> at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)
> at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134)
> at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:396)
> at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327)
> at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:284)
> at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:452)
> at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3230)
> at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processAttributes(XMLSchemaValidator.java:2707)
> at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:2050)
> at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:740)
> at com.sun.org.apache.xerces.internal.jaxp.validation.DOMValidatorHelper.beginNode(DOMValidatorHelper.java:277)
> at com.sun.org.apache.xerces.internal.jaxp.validation.DOMValidatorHelper.validate(DOMValidatorHelper.java:244)
> at com.sun.org.apache.xerces.internal.jaxp.validation.DOMValidatorHelper.validate(DOMValidatorHelper.java:190)
> at com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorImpl.validate(ValidatorImpl.java:109)
> at javax.xml.validation.Validator.validate(Validator.java:124)
> at org.apache.karaf.features.internal.model.JaxbUtil.unmarshalValidate(JaxbUtil.java:125)
> ... 28 more
> [ERROR]
> [ERROR]
>
> I'm using Java 1.8.0 and tested the results on Maven 3.0.0 and 3.5.0
>
> Best regards
> --
> Mariusz Koprowski
>

--
Jean-Baptiste Onofré
[hidden email]
http://blog.nanthrax.net
Talend - http://www.talend.com

Loading...