<?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>

    <parent>
        <groupId>org.apache.chemistry.opencmis</groupId>
        <artifactId>chemistry-opencmis</artifactId>
        <version>0.13.0</version>
        <relativePath>../../pom.xml</relativePath>
    </parent>

    <artifactId>chemistry-opencmis-client-impl</artifactId>
    <name>OpenCMIS Client Implementation</name>
    <packaging>jar</packaging>

    <properties>
        <parentBasedir>../../</parentBasedir>
    </properties>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>  
                        <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
                    </archive> 
                </configuration>
            </plugin>  
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <version>${felix.plugin.version}</version>
                <extensions>true</extensions>
                <executions>
                    <execution>
                        <id>bundle-manifest</id>
                        <phase>process-classes</phase>
                        <goals>    
                            <goal>manifest</goal>
                        </goals>   
                    </execution>
                </executions>
                <configuration>
                    <instructions>
                        <Export-Package />
                        <Bundle-DocURL>${project.url}</Bundle-DocURL>
                        <Bundle-Activator>org.apache.chemistry.opencmis.client.osgi.Activator</Bundle-Activator>
                    </instructions>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <executions>
                    <execution>
                       <id>pack-client-with-deps</id>
                       <goals>
                           <goal>single</goal>
                       </goals>
                       <phase>package</phase>
                       <configuration>
                           <attach>true</attach>
                           <descriptors>
                               <descriptor>src/main/assembly/client-with-dependencies-assembly.xml</descriptor>
                               <descriptor>src/main/assembly/client-with-ri-dependencies-assembly.xml</descriptor>
                               <descriptor>src/main/assembly/client-with-cxf-dependencies-assembly.xml</descriptor>
                           </descriptors>
                       </configuration>
                   </execution>
                </executions>
            </plugin>  
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>chemistry-opencmis-client-api</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>chemistry-opencmis-commons-api</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>chemistry-opencmis-commons-impl</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>chemistry-opencmis-client-bindings</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.core</artifactId>
            <version>${osgi.version}</version>
            <scope>provided</scope>
        </dependency>
        <!-- Sun RI -->
        <dependency>
            <groupId>org.jvnet.mimepull</groupId>
            <artifactId>mimepull</artifactId>
            <version>${mimepull.version}</version>
            <scope>provided</scope>
        </dependency> 
        <dependency>
            <groupId>com.sun.xml.ws</groupId>
            <artifactId>jaxws-rt</artifactId>
            <version>${jaxws-rt.version}</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion> <!-- included in Java 6 and above -->
                    <groupId>javax.xml.stream</groupId>
                    <artifactId>stax-api</artifactId>
                </exclusion>
                <exclusion> <!-- included in Java 6 and above -->
                    <groupId>stax</groupId>
                    <artifactId>stax-api</artifactId>
                </exclusion>
                <exclusion>	 
                    <groupId>org.codehaus.woodstox</groupId>	 
                    <artifactId>wstx-asl</artifactId>	 
                </exclusion>	 
                <exclusion>	 
                    <groupId>junit</groupId>	 
                    <artifactId>junit</artifactId>	 
                </exclusion>	 
                <exclusion>	 
                    <groupId>org.jvnet</groupId>	 
                    <artifactId>mimepull</artifactId>	 
                </exclusion>	 
            </exclusions>
        </dependency>
        <!-- CXF -->
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-frontend-jaxws</artifactId>
            <version>${cxf.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-transports-http</artifactId>
            <version>${cxf.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-ws-policy</artifactId>
            <version>${cxf.version}</version>
            <scope>provided</scope>
        </dependency>
        <!-- Test -->
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>${log4j.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>${slf4j.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <profiles>
        <profile>
            <!--
                call mvn test -Dorg.apache.chemistry.opencmis.client.runtime.suite.config.path=myServer.properties to
                run test using profile parameters
            -->
            <activation>
                <property>
                    <name>org.apache.chemistry.opencmis.client.runtime.test.config.path</name>
                </property>
            </activation>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-surefire-plugin</artifactId>
                            <configuration>
                                <argLine>-Dorg.apache.chemistry.opencmis.client.runtime.test.config.path=${org.apache.chemistry.opencmis.client.runtime.test.config.path}</argLine>
                            </configuration>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>
        </profile>

        <!--
            Extending the default -Papache-release profile used *only*
            during releases
        -->
        <profile>
            <id>apache-release</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-assembly-plugin</artifactId>
                        <inherited>false</inherited>
                        <executions>
                            <execution>
                                <id>pack-client-with-deps</id>
                                <goals>
                                    <goal>single</goal>
                                </goals>
                                <phase>package</phase>
                                <configuration>
                                    <attach>true</attach>
                                    <descriptors>
                                        <descriptor>
                                            src/main/assembly/client-with-dependencies-assembly.xml
                                         </descriptor>
                                    </descriptors>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>


</project>
