<?xml version='1.0' encoding='UTF-8' ?>
<!--
  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.
-->
<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/maven-v4_0_0.xsd">

  <modelVersion>4.0.0</modelVersion>
  <artifactId>cxf-dosgi-ri-multibundle-distribution</artifactId>
  <!-- Do not delete version. It is read by the systests (MultiBundleTools) -->
  <version>1.5.0</version>
  <name>Distributed OSGI Multi-Bundle Distribution</name>
  <url>http://cxf.apache.org</url>

  <parent>
    <groupId>org.apache.cxf.dosgi</groupId>
    <artifactId>cxf-dosgi-ri-distribution-parent</artifactId>
    <version>1.5.0</version>
    <relativePath>../pom.xml</relativePath>
  </parent>

  <properties>
    <dosgi.version>${project.version}</dosgi.version>
    <topDirectoryLocation>../..</topDirectoryLocation>
  </properties>

    <dependencies>
        <dependency>
            <groupId>org.apache.geronimo.specs</groupId>
            <artifactId>geronimo-osgi-registry</artifactId>
            <version>1.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.geronimo.specs</groupId>
            <artifactId>geronimo-annotation_1.0_spec</artifactId>
            <version>1.1.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.servicemix.specs</groupId>
            <artifactId>org.apache.servicemix.specs.activation-api-1.1</artifactId>
            <version>2.2.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.geronimo.specs</groupId>
            <artifactId>geronimo-javamail_1.4_spec</artifactId>
            <version>1.7.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.geronimo.specs</groupId>
            <artifactId>geronimo-jpa_2.0_spec</artifactId>
            <version>1.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.geronimo.specs</groupId>
            <artifactId>geronimo-ws-metadata_2.0_spec</artifactId>
            <version>1.1.3</version>
        </dependency>
        <dependency>
            <groupId>org.apache.geronimo.specs</groupId>
            <artifactId>geronimo-servlet_${servlet.version}_spec</artifactId>
            <version>1.0</version>
        </dependency>
        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <version>2.6</version>
        </dependency>
        <dependency>
            <groupId>org.apache.servicemix.bundles</groupId>
            <artifactId>org.apache.servicemix.bundles.jdom</artifactId>
            <version>${jdom.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.web</groupId>
            <artifactId>pax-web-spi</artifactId>
            <version>${pax.web.version}</version>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.web</groupId>
            <artifactId>pax-web-runtime</artifactId>
            <version>${pax.web.version}</version>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.logging</groupId>
            <artifactId>pax-logging-api</artifactId>
            <version>${pax.logging.version}</version>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.logging</groupId>
            <artifactId>pax-logging-service</artifactId>
            <version>${pax.logging.version}</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.jetty.aggregate</groupId>
            <artifactId>jetty-all-server</artifactId>
            <version>${jetty.version}</version>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.web</groupId>
            <artifactId>pax-web-jetty</artifactId>
            <version>${pax.web.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.servicemix.specs</groupId>
            <artifactId>org.apache.servicemix.specs.saaj-api-1.3</artifactId>
            <version>${servicemix.specs.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.servicemix.specs</groupId>
            <artifactId>org.apache.servicemix.specs.stax-api-1.0</artifactId>
            <version>${servicemix.specs.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.servicemix.specs</groupId>
            <artifactId>org.apache.servicemix.specs.jaxb-api-2.2</artifactId>
            <version>${servicemix.specs.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.servicemix.specs</groupId>
            <artifactId>org.apache.servicemix.specs.jaxws-api-2.2</artifactId>
            <version>${servicemix.specs.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.servicemix.specs</groupId>
            <artifactId>org.apache.servicemix.specs.jsr339-api-m10</artifactId>
            <version>${servicemix.specs.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.ws.xmlschema</groupId>
            <artifactId>xmlschema-core</artifactId>
            <version>${xmlschema.bundle.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.servicemix.bundles</groupId>
            <artifactId>org.apache.servicemix.bundles.xmlresolver</artifactId>
            <version>${xmlresolver.bundle.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.neethi</groupId>
            <artifactId>neethi</artifactId>
            <version>${neethi.bundle.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.servicemix.bundles</groupId>
            <artifactId>org.apache.servicemix.bundles.wsdl4j</artifactId>
            <version>${wsdl4j.bundle.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.santuario</groupId>
            <artifactId>xmlsec</artifactId>
            <version>${xmlsec.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.servicemix.bundles</groupId>
            <artifactId>org.apache.servicemix.bundles.jaxb-impl</artifactId>
            <version>${jaxbimpl.bundle.version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.servicemix.bundles</groupId>
            <artifactId>org.apache.servicemix.bundles.asm</artifactId>
            <version>${asm.bundle.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.servicemix.bundles</groupId>
            <artifactId>org.apache.servicemix.bundles.commons-pool</artifactId>
            <version>${commons.pool.bundle.version}</version>
        </dependency>

        <dependency>
            <groupId>org.codehaus.woodstox</groupId>
            <artifactId>stax2-api</artifactId>
            <version>3.1.1</version>
        </dependency>
        <dependency>
            <groupId>org.codehaus.woodstox</groupId>
            <artifactId>woodstox-core-asl</artifactId>
            <version>${woodstox.bundle.version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.servicemix.bundles</groupId>
            <artifactId>org.apache.servicemix.bundles.joda-time</artifactId>
            <version>1.5.2_4</version>
        </dependency>

        <dependency>
            <groupId>org.apache.aries</groupId>
            <artifactId>org.apache.aries.util</artifactId>
            <version>1.1.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.aries.proxy</groupId>
            <artifactId>org.apache.aries.proxy.api</artifactId>
            <version>1.0.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.aries.proxy</groupId>
            <artifactId>org.apache.aries.proxy.impl</artifactId>
            <version>1.0.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.aries.blueprint</groupId>
            <artifactId>org.apache.aries.blueprint.api</artifactId>
            <version>1.0.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.aries.blueprint</groupId>
            <artifactId>org.apache.aries.blueprint.core</artifactId>
            <version>1.1.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.aries.blueprint</groupId>
            <artifactId>org.apache.aries.blueprint.cm</artifactId>
            <version>1.0.1</version>
        </dependency>

        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-api</artifactId>
            <version>${cxf.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-core</artifactId>
            <version>${cxf.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-frontend-simple</artifactId>
            <version>${cxf.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-frontend-jaxws</artifactId>
            <version>${cxf.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-frontend-jaxrs</artifactId>
            <version>${cxf.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-bindings-xml</artifactId>
            <version>${cxf.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-bindings-soap</artifactId>
            <version>${cxf.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-databinding-jaxb</artifactId>
            <version>${cxf.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-databinding-aegis</artifactId>
            <version>${cxf.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-ws-policy</artifactId>
            <version>${cxf.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-transports-http</artifactId>
            <version>${cxf.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-transports-http-jetty</artifactId>
            <version>${cxf.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-rs-extension-providers</artifactId>
            <version>${cxf.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-bundle-compatible</artifactId>
            <version>${cxf.version}</version>
            <!-- <exclusions> <exclusion> <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-rt-transports-jms</artifactId> </exclusion> </exclusions> -->
        </dependency>

        <dependency>
            <groupId>org.apache.cxf.dosgi</groupId>
            <artifactId>cxf-dosgi-ri-discovery-local</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf.dosgi</groupId>
            <artifactId>cxf-dosgi-ri-dsw-cxf</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf.dosgi</groupId>
            <artifactId>cxf-dosgi-ri-topology-manager</artifactId>
            <version>${project.version}</version>
        </dependency>

        <!-- Discovery dependencies -->
        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.configadmin</artifactId>
            <version>1.6.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.fileinstall</artifactId>
            <version>3.2.6</version>
        </dependency>

        <dependency>
            <groupId>org.apache.zookeeper</groupId>
            <artifactId>zookeeper</artifactId>
            <version>${zookeeper.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>com.sun.jdmk</groupId>
                    <artifactId>jmxtools</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.sun.jmx</groupId>
                    <artifactId>jmxri</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>log4j</groupId>
                    <artifactId>log4j</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf.dosgi</groupId>
            <artifactId>cxf-dosgi-ri-discovery-distributed</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.enterprise</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf.dosgi</groupId>
            <artifactId>cxf-dosgi-ri-discovery-distributed-zookeeper-server</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf.dosgi</groupId>
            <artifactId>cxf-dosgi-ri-discovery-distributed-zookeeper-server-config</artifactId>
            <version>${project.version}</version>
        </dependency>

    </dependencies>

  <build>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
      </resource>
    </resources>

    <plugins>
    <plugin>
        <groupId>org.apache.karaf.tooling</groupId>
        <artifactId>features-maven-plugin</artifactId>
        <version>2.2.7</version>

        <executions>
          <execution>
            <id>add-features-to-repo</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>add-features-to-repo</goal>
            </goals>
            <configuration>
              <descriptors>
                <descriptor>mvn:org.apache.cxf.dosgi/cxf-dosgi/${project.version}/xml/features</descriptor>
              </descriptors>
              <features>
                <feature>cxf-dosgi-discovery-distributed</feature>
              </features>
              <repository>target/dosgi</repository>
            </configuration>
          </execution>
          <execution>
            <id>add-features-to-repo2</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>add-features-to-repo</goal>
            </goals>
            <configuration>
              <descriptors>
                <descriptor>mvn:org.apache.cxf.dosgi/cxf-dosgi/${project.version}/xml/features</descriptor>
              </descriptors>
              <features>
                <feature>cxf-dosgi-discovery-distributed</feature>
              </features>
              <repository>target/dosgi-discovery-zookeeper</repository>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>copy-deps</id>
            <phase>process-resources</phase>
            <goals>
              <goal>copy-dependencies</goal>
            </goals>
            <configuration>
              <excludeTransitive>true</excludeTransitive>
              <outputDirectory>${project.build.directory}/distribution_bundles</outputDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <executions>
          <execution>
            <id>make-assembly</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <descriptors>
                <descriptor>./src/main/assembly/assembly.xml</descriptor>
              </descriptors>
            </configuration>

          </execution>
        </executions>
      </plugin>

      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <phase>compile</phase>
            <configuration>
              <target>
                <path id="current.dir.path">
                  <pathelement location="." />
                </path>
                <pathconvert targetos="unix" property="current.dir" refid="current.dir.path" />

                <xslt processor="trax" in="target/classes/distro_bundles.xml" out="target/distribution_configs/felix.config.properties.append" style="src/main/xsl/felix_distro_config.xslt">
                    <param name="Version" expression="${dosgi.version}" />
                    <param name="Offset" expression="50" />
                </xslt>

                <xslt processor="trax" in="target/classes/distro_bundles.xml" out="target/felix.config.properties.append" style="src/main/xsl/felix_buildsystem_config.xslt">
                      <param name="TargetDir" expression="${current.dir}/target/" />
                      <param name="Offset" expression="50" />
                </xslt>

                <xslt processor="trax" in="target/classes/distro_bundles.xml" out="target/distribution_configs/equinox.config.ini.append" style="src/main/xsl/equinox_distro_config.xslt">
                    <param name="Version" expression="${dosgi.version}" />
                </xslt>

                <xslt processor="trax" in="target/classes/distro_bundles.xml" out="target/equinox.config.ini.append" style="src/main/xsl/equinox_buildsystem_config.xslt">
                      <param name="TargetDir" expression="${current.dir}/target/" />
                </xslt>

                <xslt processor="trax" in="target/classes/distro_discovery_bundles.xml" out="target/distribution_configs/felix.discovery.config.properties.append" style="src/main/xsl/felix_distro_config.xslt">
                    <param name="Version" expression="${dosgi.version}" />
                    <param name="Offset" expression="120" />
                </xslt>

                <xslt processor="trax" in="target/classes/distro_discovery_bundles.xml" out="target/felix.discovery.config.properties.append" style="src/main/xsl/felix_buildsystem_config.xslt">
                      <param name="TargetDir" expression="${current.dir}/target/" />
                      <param name="Offset" expression="120" />
                </xslt>

                <xslt processor="trax" in="target/classes/distro_discovery_bundles.xml" out="target/distribution_configs/equinox.discovery.config.ini.append" style="src/main/xsl/equinox_distro_config.xslt">
                    <param name="Version" expression="${dosgi.version}" />
                </xslt>

                <xslt processor="trax" in="target/classes/distro_discovery_bundles.xml" out="target/equinox.discovery.config.ini.append" style="src/main/xsl/equinox_buildsystem_config.xslt">
                      <param name="TargetDir" expression="${current.dir}/target/" />
                </xslt>
              </target>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
