<?xml version="1.0" encoding="UTF-8"?>

    <!--
        Licensed 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.8.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>2.3.4</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 />
                        <Import-Package>
                          org.apache.commons.codec.*;version="[1.4,2.0)",
                          org.apache.commons.logging.*;version="[1.1,2.0)",
                          *
                        </Import-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>
                <version>2.3</version>
                <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>

    <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.apache.felix</groupId>
            <artifactId>org.osgi.core</artifactId>
            <version>1.0.0</version>
        </dependency>
        <dependency>
	        <groupId>log4j</groupId>
	        <artifactId>log4j</artifactId>
	        <version>1.2.16</version>
	        <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>1.6.6</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>
