<?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.9.0</version>
        <relativePath>../../pom.xml</relativePath>
    </parent>
    
    <artifactId>chemistry-opencmis-commons-impl</artifactId>
    <name>OpenCMIS Commons Implementation</name>
    <packaging>jar</packaging>

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

    <dependencies>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>chemistry-opencmis-commons-api</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.codehaus.woodstox</groupId>
            <artifactId>woodstox-core-asl</artifactId>
            <version>4.2.0</version>
        </dependency>
        <dependency>
            <groupId>com.sun.xml.ws</groupId>
            <artifactId>jaxws-rt</artifactId>
            <version>2.1.7</version>
            <exclusions>
                <exclusion>
                    <groupId>stax</groupId>
                    <artifactId>stax-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.codehaus.woodstox</groupId>
                    <artifactId>wstx-asl</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
        		<groupId>org.codehaus.mojo</groupId>
		        <artifactId>build-helper-maven-plugin</artifactId>
		        <version>1.8</version>
        		<executions>
		        	<execution>
		            	<id>add-source</id>
	            		<phase>generate-sources</phase>
	            		<goals>
	              			<goal>add-source</goal>
	            		</goals>
			            <configuration>
    	    		    	<sources>
        	        			<source>./target/generated</source>
            	    		</sources>
            			</configuration>
          			</execution>
        		</executions>
      		</plugin>
            <plugin>
                <groupId>org.jvnet.jax-ws-commons</groupId>
                <artifactId>jaxws-maven-plugin</artifactId>
                <version>2.2</version>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>wsimport</goal>
                        </goals>
                        <configuration>
                            <wsdlDirectory>${project.basedir}/src/main/resources/wsdl/cmis11</wsdlDirectory>
                            <wsdlFiles>
                                <wsdlFile>CMISWS-Service.wsdl</wsdlFile>
                            </wsdlFiles>
                            <packageName>org.apache.chemistry.opencmis.commons.impl.jaxb</packageName>
                            <destdir />
                            <sourceDestDir>${project.basedir}/target/generated</sourceDestDir>
                            <extension>true</extension>
                            <target>2.1</target>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <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>
                          org.apache.chemistry.opencmis.commons.impl.*;version=${project.version}
                        </Export-Package>
                        <Import-Package>
                          org.apache.commons.codec.*;version="[1.4,2.0)",
                          org.apache.commons.logging.*;version="[1.1,2.0)",
                          org.apache.chemistry.opencmis.commons.*,
                          com.sun.xml.ws.*;version="[2.1.7,3.0)";resolution:=optional,
                          *
                        </Import-Package>
                        <Bundle-DocURL>${project.url}</Bundle-DocURL>
                    </instructions>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>
