<?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-singlebundle-distribution</artifactId>
    <version>1.4.0</version>
    <packaging>bundle</packaging>
  <name>Distributed OSGI Single-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.4.0</version>
    <relativePath>../pom.xml</relativePath>
  </parent>

  <properties>
    <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.1</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-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>org.slf4j</groupId>  
        <artifactId>slf4j-api</artifactId>  
    </dependency>
    <dependency>  
        <groupId>org.slf4j</groupId>  
        <artifactId>slf4j-jcl</artifactId>  
    </dependency>
    <dependency>
      <groupId>org.ops4j.pax.web</groupId>
      <artifactId>pax-web-runtime</artifactId>
      <version>${pax.web.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.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.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.felix</groupId>
      <artifactId>org.apache.felix.configadmin</artifactId>
      <version>1.2.8</version>
    </dependency>      
    <dependency>
      <groupId>org.apache.felix</groupId>
      <artifactId>org.apache.felix.fileinstall</artifactId>
      <version>3.1.10</version>
    </dependency>      
    <dependency>
      <groupId>commons-lang</groupId>
      <artifactId>commons-lang</artifactId>
      <version>2.6</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>
    <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.servicemix.bundles</groupId>
        <artifactId>org.apache.servicemix.bundles.jdom</artifactId>
        <version>${jdom.version}</version>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>  
    <dependency>
      <groupId>org.easymock</groupId>
      <artifactId>easymockclassextension</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>        

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <configuration>
          <instructions>
            <Bundle-Name>Distributed OSGi Distribution Software Single-Bundle Distribution</Bundle-Name>
            <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
            <Bundle-Vendor>The Apache Software Foundation</Bundle-Vendor>
            <Bundle-Activator>org.apache.cxf.dosgi.singlebundle.AggregatedActivator</Bundle-Activator>
            <Include-Resource>
              @cxf-bundle-minimal-${cxf.version}.jar!/META-INF/spring.*,
              @cxf-bundle-minimal-${cxf.version}.jar!/META-INF/cxf/*,
              {maven-resources}
            </Include-Resource>
            <Import-Package>
              javax.servlet.descriptor;resolution:=optional,
              javax.servlet.*;version="[2.3.0,4.0)",
              org.osgi.service.blueprint*;resolution:=optional,
              org.osgi.service.event,
              org.osgi.service.remoteserviceadmin,
              org.osgi.*,
            </Import-Package>
            <Export-Package>
              '=META-INF.cxf',
              org.apache.cxf.dosgi.singlebundle;version="${project.version}"
            </Export-Package>
            <Embed-Dependency>*;scope=compile;inline=false</Embed-Dependency>
            <Embed-Directory>lib</Embed-Directory>
            <_exportcontents>
              javax.xml.ws.*;version="2.1.0",
              javax.ws.rs.*;version="2.0.0", 
              javax.jws.*;version="2.0.0", 
              javax.xml.bind.annotation.*;version="2.1",
              javax.servlet.*;version="2.5.0",
              org.apache.cxf.dosgi.*;version="${project.version}",
              org.apache.cxf.*;version="${cxf.version}",
              org.jdom.*;version="1.1.0",
              org.osgi.jmx.*,
              org.osgi.service.*,
              org.osgi.util.*,
              !*
            </_exportcontents> 
            <DynamicImport-Package>*</DynamicImport-Package>
            <_failok>true</_failok>
            <_removeheaders>
              Ignore-Package,
              Include-Resource,
              Private-Package,
              Embed-Dependency
            </_removeheaders>
          </instructions>
        </configuration>
      </plugin> 

      
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <phase>package</phase>
            <configuration>
              <target>
                <!-- removing this directory as it confuses Eclipse when importing the bundle as a plugin -->
                <delete dir="target/classes" />

                <fileset dir="target" id="single.bundle">
                  <include name="*.jar" />
                </fileset>
                <pathconvert pathsep="" property="bundle" refid="single.bundle" />

                <!-- config.properties file for Felix -->
                <echo file="target/felix.config.properties.append">
org.ops4j.pax.web.session.timeout=30
org.osgi.framework.startlevel=2
felix.auto.start.2=
                </echo>
                <echo message="file:/${bundle}" file="target/felix.config.properties.append" append="true" />
                <replace file="target/felix.config.properties.append" token="\" value="/" />

                <!-- config.ini file for Equinox -->
                <echo file="target/equinox.config.ini.append">
org.ops4j.pax.web.session.timeout=30

osgi.bundles=org.eclipse.osgi.services@start, 
                </echo>
                <echo message="${bundle}@start" file="target/equinox.config.ini.append" append="true" />
                <replace file="target/equinox.config.ini.append" token="\" value="/" />
              </target>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
