Sure but I can't give the whole project as it's a corporate project and I'm
not allowed to that.
If you need a whole project, I can try to reproduce it and push it my
github.

- features1.xml is the feature from the first project
- features2.xml is the feature from my module in the second project
- pom.xml is the pom my distribution module

Rgds,

Arnaud

On Sun, Nov 22, 2015 at 9:14 PM Jean-Baptiste Onofré <[email protected]>
wrote:

> Can you share the pom.xml and features.xml ?
>
> Regards
> JB
>
> On 11/22/2015 09:11 PM, Arnaud Deprez wrote:
> > Hi JB,
> >
> > Sorry, I don't get what you mean by template or dependencies set.
> >
> > So basically, in my second project, I have a features maven module where
> > I'm defining the features.xml file. This file is templated with maven
> > properties and I use the maven resource plugin to replace properties
> > with maven property placeholder.
> >
> > Then, I have another module distribution where my configuration is :
> >
> > ...
> > <dependencies>
> >          <dependency>
> >              <groupId>${project.groupId}</groupId>
> >              <artifactId>features</artifactId>
> >              <version>${project.version}</version>
> >              <type>xml</type>
> >              <classifier>features</classifier>
> >          </dependency>
> >          <dependency>
> >              <groupId>be.lampiris.pie2.el2</groupId>
> >              <artifactId>el2-common-query-features</artifactId>
> >              <version>${lampiris.query.version}</version>
> >              <type>xml</type>
> >              <classifier>features</classifier>
> >          </dependency>
> >      </dependencies>
> > ...
> >              <plugin>
> >                  <groupId>org.apache.karaf.tooling</groupId>
> >                  <artifactId>karaf-maven-plugin</artifactId>
> >                  <version>${karaf-plugin.version}</version>
> >                  <extensions>true</extensions>
> >                  <executions>
> >                      <execution>
> >                          <id>features-generate-descriptor</id>
> >                          <phase>package</phase>
> >                          <goals>
> >                              <goal>features-generate-descriptor</goal>
> >                          </goals>
> >                          <configuration>
> >                              <aggregateFeatures>true</aggregateFeatures>
> >                          </configuration>
> >                      </execution>
> >                      <execution>
> >                          <id>kar</id>
> >                          <phase>install</phase>
> >                          <goals>
> >                              <goal>kar</goal>
> >                          </goals>
> >                          <configuration>
> >
> >
> <finalName>Lampiris-${project.parent.artifactId}-${project.version}</finalName>
> >
> > <ignoreDependencyFlag>true</ignoreDependencyFlag>
> >
> >
> <featuresFile>${project.build.directory}/feature/feature.xml</featuresFile>
> >                          </configuration>
> >                      </execution>
> >                  </executions>
> >              </plugin>
> > ...
> >
> > So I use dependencies to import my 2 features files.
> > Does it help ?
> >
> > Regards,
> >
> > Arnaud
> >
> > On Sun, Nov 22, 2015 at 8:51 PM Jean-Baptiste Onofré <[email protected]
> > <mailto:[email protected]>> wrote:
> >
> >     Hi Arnaud,
> >
> >     Hmmm, it sounds like a bug.
> >
> >     Do you use a template for the generate descriptor or does it use the
> >     dependencies set ?
> >
> >     Regards
> >     JB
> >
> >     On 11/22/2015 08:34 PM, Arnaud Deprez wrote:
> >      > Hi folks,
> >      >
> >      > I'm trying to use the karaf-maven-plugin to generate a kar file.
> >      >
> >      > Here is my configuration:
> >      > I have 2 projects, one depends on the other. Each project has its
> own
> >      > feature file.
> >      > In my second project, I defined the following configuration :
> >      > <plugin>
> >      >                  <groupId>org.apache.karaf.tooling</groupId>
> >      >                  <artifactId>karaf-maven-plugin</artifactId>
> >      >                  <version>${karaf-plugin.version}</version>
> >      >                  <extensions>true</extensions>
> >      >                  <executions>
> >      >                      <execution>
> >      >                          <id>features-generate-descriptor</id>
> >      >                          <phase>package</phase>
> >      >                          <goals>
> >      >
> >     <goal>features-generate-descriptor</goal>
> >      >                          </goals>
> >      >                          <configuration>
> >      >
> >     <aggregateFeatures>true</aggregateFeatures>
> >      >                          </configuration>
> >      >                      </execution>
> >      >                      <execution>
> >      >                          <id>kar</id>
> >      >                          <phase>install</phase>
> >      >                          <goals>
> >      >                              <goal>kar</goal>
> >      >                          </goals>
> >      >                          <configuration>
> >      >
> >      >
> >
>  
> <finalName>Lampiris-${project.parent.artifactId}-${project.version}</finalName>
> >      >
> >      > <ignoreDependencyFlag>true</ignoreDependencyFlag>
> >      >
> >      >
> >
>  
> <!--<featuresFile>${project.build.directory}/classes/features.xml</featuresFile>-->
> >      >
> >      >
> >
>  <featuresFile>${project.build.directory}/feature/feature.xml</featuresFile>
> >      >                          </configuration>
> >      >                      </execution>
> >      >                  </executions>
> >      >              </plugin>
> >      >
> >      > As I've imported the 2 features files in my dependencies, it
> >     works fine.
> >      > Except that in the second feature, I've defined <repository> (for
> >      > example to choose the right camel version) and those tags aren't
> >      > aggregated in the final feature.xml generated.
> >      >
> >      > I didn't find any useful information to achieve that in the
> >      > documentation. So that's my question : is there a way to also
> >     aggregate
> >      > repository tags ?
> >      >
> >      > Regards,
> >      >
> >      > Arnaud
> >
> >     --
> >     Jean-Baptiste Onofré
> >     [email protected] <mailto:[email protected]>
> >     http://blog.nanthrax.net
> >     Talend - http://www.talend.com
> >
>
> --
> Jean-Baptiste Onofré
> [email protected]
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>
<?xml version="1.0" encoding="UTF-8" ?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.3.0";
          name="Lampiris : el2-common-query-features">

    <!-- Remarks: before choose cxf version >= 3.1.2 & camel 2.15.2 -->
    <feature name="el2-common-query" version="6.0.0-SNAPSHOT">
        <!-- features -->
        <feature>pax-cdi-1.2</feature>
        <feature>cxf</feature>
        <feature>camel</feature>
        <feature>camel-gson</feature>

        <!-- Dependencies -->
        <bundle>mvn:org.apache.cxf/cxf-rt-rs-extension-search/3.1.2</bundle>
        <bundle>mvn:com.google.guava/guava/18.0</bundle>
        <bundle>mvn:org.apache.commons/commons-lang3/3.4</bundle>
        <bundle>mvn:be.lampiris.pie2.el2/el2-common-exception/4.0.0</bundle>
        <bundle>mvn:be.lampiris.pie2.el2/el2-common-util/4.1.0</bundle>
        <bundle>mvn:org.apache.olingo/olingo-odata2-api/2.0.4</bundle>
        <bundle>mvn:org.apache.olingo/olingo-odata2-core/2.0.4</bundle>

        <!-- el2-common-query -->
        <bundle>mvn:be.lampiris.pie2.el2/el2-common-query/6.0.0-SNAPSHOT</bundle>
        <bundle>mvn:be.lampiris.pie2.el2/el2-common-query-fiql/6.0.0-SNAPSHOT</bundle>
        <bundle>mvn:be.lampiris.pie2.el2/el2-common-query-odata2/6.0.0-SNAPSHOT</bundle>
    </feature>
</features>
<?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";>
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <artifactId>enterprise-api</artifactId>
        <groupId>be.lampiris.api</groupId>
        <version>1.0.0-SNAPSHOT</version>
    </parent>

    <artifactId>distribution</artifactId>
    <packaging>pom</packaging>

    <properties>
        <docker.assemblyDescriptor>${project.basedir}/src/main/resources/docker/assembly.xml</docker.assemblyDescriptor>
        <docker.from>arnaudeprez/karaf:4</docker.from>
        <docker.image>lampiris/enterprise-api-karaf:1</docker.image>
        <docker.port.container.http>8181</docker.port.container.http>
        <docker.port.container.jolokia>8778</docker.port.container.jolokia>
        <karaf-plugin.version>4.0.3</karaf-plugin.version>
        <karaf.version>${karaf-plugin.version}</karaf.version>
    </properties>

    <dependencies>
        <!--Need to declare its own dependeicies for karaf-maven-plugin features-generate-descriptor-->
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>features</artifactId>
            <version>${project.version}</version>
            <type>xml</type>
            <classifier>features</classifier>
        </dependency>
        <dependency>
            <groupId>be.lampiris.pie2.el2</groupId>
            <artifactId>el2-common-query-features</artifactId>
            <version>${lampiris.query.version}</version>
            <type>xml</type>
            <classifier>features</classifier>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.karaf.tooling</groupId>
                <artifactId>karaf-maven-plugin</artifactId>
                <version>${karaf-plugin.version}</version>
                <extensions>true</extensions>
                <executions>
                    <execution>
                        <id>features-generate-descriptor</id>
                        <phase>package</phase>
                        <goals>
                            <goal>features-generate-descriptor</goal>
                        </goals>
                        <configuration>
                            <aggregateFeatures>true</aggregateFeatures>
                        </configuration>
                    </execution>
                    <execution>
                        <id>kar</id>
                        <phase>install</phase>
                        <goals>
                            <goal>kar</goal>
                        </goals>
                        <configuration>
                            <finalName>Lampiris-${project.parent.artifactId}-${project.version}</finalName>
                            <ignoreDependencyFlag>true</ignoreDependencyFlag>
                            <!--<featuresFile>${project.build.directory}/classes/features.xml</featuresFile>-->
                            <featuresFile>${project.build.directory}/feature/feature.xml</featuresFile>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.jolokia</groupId>
                <artifactId>docker-maven-plugin</artifactId>
                <configuration>
                    <images>
                        <image>
                            <name>${docker.image}</name>
                            <build>
                                <from>${docker.from}</from>
                                <assembly>
                                    <basedir>/opt/karaf/deploy</basedir>
                                    <descriptor>${docker.assemblyDescriptor}</descriptor>
                                </assembly>
                            </build>
                        </image>
                    </images>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
<?xml version="1.0" encoding="UTF-8" ?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.3.0";
          name="Lampiris :: Enterprise API : features">

    <repository>mvn:be.lampiris.pie2.el2/el2-common-query-features/6.0.0-SNAPSHOT/xml/features</repository>

    <feature name="enterprise-api-base" version="1.0.0-SNAPSHOT">
        <!-- allow camel to access its own mbeans for karaf commands and other needs -->
        <config name="jmx.acl.org.apache.camel">
            * = *
        </config>
        <configfile finalname="etc/hazelcast.xml">mvn:be.lampiris.api/features/1.0.0-SNAPSHOT/xml/hazelcast</configfile>
        <feature>war</feature>
        <feature>camel</feature>
        <feature>camel-metrics</feature>
        <feature>camel-servlet</feature>
        <feature>camel-jackson</feature>
        <feature>camel-bean-validator</feature>
        <feature>camel-http4</feature>
        <feature>camel-hazelcast</feature>
        <feature>camel-jsonpath</feature>
        <feature version="6.0.0-SNAPSHOT">el2-common-query</feature>
        <feature version="1.0.0-SNAPSHOT">enterprise-security</feature>
        <feature version="1.0.0-SNAPSHOT">enterprise-shared</feature>
        <!-- Blueprint hot deploy-->
        <bundle>blueprint:mvn:be.lampiris.api/features/1.0.0-SNAPSHOT/xml/camel-http-servlet</bundle>
        <!--<bundle>blueprint:mvn:be.lampiris.api/features/1.0.0-SNAPSHOT/xml/camel-swagger-servlet</bundle>-->
        <bundle>blueprint:mvn:be.lampiris.api/features/1.0.0-SNAPSHOT/xml/hazelcast-service</bundle>
    </feature>

    <feature name="enterprise-security" version="1.0.0-SNAPSHOT">

        <!-- Redefine feature camel-spring-security -->
        <!--<feature>camel-spring-security</feature>-->
        <feature>http</feature>
        <feature>camel-spring</feature>
        <feature version="[3.2,4.0)">spring-web</feature>
        <bundle>mvn:org.springframework.security/spring-security-core/3.2.5.RELEASE</bundle>
        <!--<bundle>mvn:org.springframework.security/spring-security-config/3.2.5.RELEASE</bundle> It depends spring-ldap which-->
        <bundle>mvn:org.springframework.security/spring-security-config/3.1.7.RELEASE</bundle>
        <bundle>mvn:org.springframework.security/spring-security-web/3.2.5.RELEASE</bundle>
        <bundle>mvn:org.springframework.security/spring-security-aspects/3.2.5.RELEASE</bundle>
        <bundle>mvn:org.apache.camel/camel-spring-security/2.16.0</bundle>
        <!-- End of redefining camel-spring-security -->

        <feature>camel-test</feature>
        <feature version="[3.1,4.0)">spring-jdbc</feature>
        <bundle>mvn:org.codehaus.jackson/jackson-core-asl/1.9.13</bundle>
        <bundle>mvn:org.codehaus.jackson/jackson-mapper-asl/1.9.13</bundle>
        <bundle>mvn:org.springframework.security.oauth/spring-security-oauth2/1.0.5.RELEASE</bundle>
        <bundle>wrap:mvn:org.cloudfoundry.identity/cloudfoundry-identity-common/1.4.1</bundle>
    </feature>

    <feature name="enterprise-shared" version="1.0.0-SNAPSHOT">
        <feature>camel-jackson</feature>
        <bundle>mvn:be.lampiris.api/utils/1.0.0-SNAPSHOT</bundle>
        <bundle>mvn:be.lampiris.api/common-api/1.0.0-SNAPSHOT</bundle>
        <bundle>mvn:be.lampiris.api/exception/1.0.0-SNAPSHOT</bundle>
    </feature>

    <feature name="enterprise-document" version="1.0.0-SNAPSHOT">
        <feature version="1.0.0-SNAPSHOT">enterprise-api-base</feature>
        <bundle>mvn:be.lampiris.api/document-api/1.0.0-SNAPSHOT</bundle>
        <bundle>mvn:be.lampiris.api/document-core/1.0.0-SNAPSHOT</bundle>
    </feature>

    <feature name="enterprise-customer" version="1.0.0-SNAPSHOT">
        <feature version="1.0.0-SNAPSHOT">enterprise-api-base</feature>
        <bundle>mvn:be.lampiris.api/customer-api/1.0.0-SNAPSHOT</bundle>
        <bundle>mvn:be.lampiris.api/customer-impl/1.0.0-SNAPSHOT</bundle>
        <bundle>mvn:be.lampiris.api/customer-rest/1.0.0-SNAPSHOT</bundle>
    </feature>

    <feature name="enterprise-contact" version="1.0.0-SNAPSHOT">
        <feature version="1.0.0-SNAPSHOT">enterprise-api-base</feature>
        <bundle>mvn:be.lampiris.api/contact-api/1.0.0-SNAPSHOT</bundle>
        <bundle>mvn:be.lampiris.api/contact-impl/1.0.0-SNAPSHOT</bundle>
        <bundle>mvn:be.lampiris.api/contact-rest/1.0.0-SNAPSHOT</bundle>
    </feature>

    <feature name="enterprise-invoice" version="1.0.0-SNAPSHOT">
        <feature version="1.0.0-SNAPSHOT">enterprise-api-base</feature>
        <bundle>mvn:be.lampiris.api/invoice-api/1.0.0-SNAPSHOT</bundle>
        <bundle>mvn:be.lampiris.api/invoice-impl/1.0.0-SNAPSHOT</bundle>
        <bundle>mvn:be.lampiris.api/invoice-rest/1.0.0-SNAPSHOT</bundle>
    </feature>

    <feature name="enterprise-contract" version="1.0.0-SNAPSHOT">
        <feature version="1.0.0-SNAPSHOT">enterprise-api-base</feature>
        <bundle>mvn:be.lampiris.api/contract-api/1.0.0-SNAPSHOT</bundle>
        <bundle>mvn:be.lampiris.api/contract-impl/1.0.0-SNAPSHOT</bundle>
        <bundle>mvn:be.lampiris.api/contract-rest/1.0.0-SNAPSHOT</bundle>
    </feature>
</features>

Reply via email to