<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">
<!--
  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>org.apache.cxf.dosgi</groupId>
  <artifactId>cxf-dosgi-ri-multibundle-distribution</artifactId>
  <version>1.1</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.1</version>
    <relativePath>../pom.xml</relativePath>
  </parent>

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

  <dependencies>
    <dependency>
      <groupId>org.apache.geronimo.specs</groupId>
      <artifactId>geronimo-annotation_1.0_spec</artifactId>
      <version>1.1.1</version>
    </dependency>
    <dependency>
      <groupId>org.apache.geronimo.specs</groupId>
      <artifactId>geronimo-activation_1.1_spec</artifactId>
      <version>1.0.2</version>
    </dependency>
    <dependency>
      <groupId>org.apache.geronimo.specs</groupId>
      <artifactId>geronimo-javamail_1.4_spec</artifactId>
      <version>1.2</version>
    </dependency>
    <dependency>
      <groupId>org.apache.geronimo.specs</groupId>
      <artifactId>geronimo-ws-metadata_2.0_spec</artifactId>
      <version>1.1.2</version>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>com.springsource.org.apache.commons.logging</artifactId>
      <version>1.1.1</version>
    </dependency>
    <dependency>
      <groupId>org.jdom</groupId>
      <artifactId>com.springsource.org.jdom</artifactId>
      <version>1.0.0</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.aopalliance</groupId>
      <artifactId>com.springsource.org.aopalliance</artifactId>
      <version>1.0.0</version>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-aop</artifactId>
      <version>${spring.version}</version>
    </dependency>
    <dependency>
      <groupId>org.springframework.osgi</groupId>
      <artifactId>spring-osgi-io</artifactId>
      <version>${spring.osgi.version}</version>
    </dependency>
    <dependency>
      <groupId>org.springframework.osgi</groupId>
      <artifactId>spring-osgi-core</artifactId>
      <version>${spring.osgi.version}</version>
    </dependency>
    <dependency>
      <groupId>org.springframework.osgi</groupId>
      <artifactId>spring-osgi-extender</artifactId>
      <version>${spring.osgi.version}</version>
    </dependency>
    <dependency>
      <groupId>org.ops4j.pax.web</groupId>
      <artifactId>pax-web-service</artifactId>
      <version>0.5.1</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.1</artifactId>
      <version>${servicemix.specs.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.servicemix.specs</groupId>
      <artifactId>org.apache.servicemix.specs.jaxws-api-2.1</artifactId>
      <version>${servicemix.specs.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.servicemix.specs</groupId>
      <artifactId>org.apache.servicemix.specs.jsr311-api-1.0</artifactId>
      <version>${servicemix.specs.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.servicemix.bundles</groupId> 
      <artifactId>org.apache.servicemix.bundles.xmlschema</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.servicemix.bundles</groupId> 
       <artifactId>org.apache.servicemix.bundles.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.servicemix.bundles</groupId> 
       <artifactId>org.apache.servicemix.bundles.xmlsec</artifactId> 
       <version>${xmlsec.bundle.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.woodstox</artifactId> 
       <version>${woodstox.bundle.version}</version> 
    </dependency>
    
    <dependency>
      <groupId>org.apache.cxf</groupId>
      <artifactId>cxf-bundle-minimal</artifactId>
      <version>${cxf.version}</version>
    </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>
    
    <!-- Discovery dependencies -->
    <dependency>
      <groupId>org.apache.felix</groupId>
      <artifactId>org.apache.felix.configadmin</artifactId>
      <version>1.0.10</version>
    </dependency>      
    <dependency>
      <groupId>org.apache.felix</groupId>
      <artifactId>org.apache.felix.fileinstall</artifactId>
      <version>1.0.0</version>
    </dependency>      

    <dependency> 
      <groupId>org.apache.log4j</groupId> 
      <artifactId>com.springsource.org.apache.log4j</artifactId> 
      <version>${log4j.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.cxf.dosgi</groupId>
      <artifactId>cxf-dosgi-ri-discovery-distributed-zookeeper-wrapper</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.cxf.dosgi</groupId>
      <artifactId>cxf-dosgi-ri-discovery-distributed</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.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>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>copy</id>
            <phase>package</phase>
            <goals>
              <goal>copy</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>org.apache.felix</groupId>
                  <artifactId>org.osgi.compendium</artifactId>
                  <version>1.2.0</version>
                  <type>jar</type>
                  <outputDirectory>target/deps</outputDirectory>
                </artifactItem>
              </artifactItems>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <phase>compile</phase>
            <configuration>
              <tasks>
                <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="100" />
                </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="100" />
                </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>
              </tasks>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin> 
    </plugins>
  </build>
</project>
