<?xml version="1.0" encoding="UTF-8"?>
<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.xcmis</groupId>
      <artifactId>xcmis-parent</artifactId>
      <version>1.2.2</version>
   </parent>
   <artifactId>xcmis-wssoap</artifactId>
   <packaging>jar</packaging>
   <name>xCMIS :: SOAP Binding</name>
   <dependencies>
      <dependency>
         <groupId>org.xcmis</groupId>
         <artifactId>xcmis-spi</artifactId>
         <scope>compile</scope>
      </dependency>
      <dependency>
         <groupId>junit</groupId>
         <artifactId>junit</artifactId>
         <scope>test</scope>
      </dependency>
      <!-- CXF dependencies -->
      <dependency>
         <groupId>org.apache.cxf</groupId>
         <artifactId>cxf-rt-transports-http</artifactId>
      </dependency>
      <dependency>
         <groupId>org.apache.cxf</groupId>
         <artifactId>cxf-rt-frontend-jaxws</artifactId>
      </dependency>
      <dependency>
         <groupId>org.apache.cxf</groupId>
         <artifactId>cxf-rt-transports-http-jetty</artifactId>
         <exclusions>
            <exclusion>
               <groupId>org.slf4j</groupId>
               <artifactId>slf4j-jdk14</artifactId>
            </exclusion>
         </exclusions>
      </dependency>
      <dependency>
         <groupId>org.apache.cxf</groupId>
         <artifactId>cxf-rt-frontend-simple</artifactId>
      </dependency>
      <dependency>
         <groupId>org.apache.cxf</groupId>
         <artifactId>cxf-rt-databinding-jaxb</artifactId>
      </dependency>
      <dependency>
         <groupId>org.apache.cxf</groupId>
         <artifactId>cxf-tools-java2ws</artifactId>
      </dependency>
      <dependency>
         <groupId>org.apache.cxf</groupId>
         <artifactId>cxf-rt-transports-local</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.mortbay.jetty</groupId>
         <artifactId>jetty</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>stax</groupId>
         <artifactId>stax-api</artifactId>
      </dependency>
      <dependency>
         <groupId>wsdl4j</groupId>
         <artifactId>wsdl4j</artifactId>
      </dependency>
      <dependency>
         <groupId>jdom</groupId>
         <artifactId>jdom</artifactId>
      </dependency>
      <dependency>
         <groupId>org.slf4j</groupId>
         <artifactId>slf4j-log4j12</artifactId>
         <scope>test</scope>
      </dependency>
   </dependencies>

   <profiles>
      <profile>
         <id>inmemory</id>
         <activation>
            <activeByDefault>true</activeByDefault>
         </activation>
         <dependencies>
            <dependency>
               <groupId>org.xcmis</groupId>
               <artifactId>xcmis-sp-inmemory</artifactId>
               <scope>test</scope>
            </dependency>
         </dependencies>
         <build>
            <plugins>
               <plugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-surefire-plugin</artifactId>
                  <configuration>
                     <systemProperties>
                        <property>
                           <name>org.xcmis.CmisRegistryFactory</name>
                           <value>org.xcmis.sp.inmemory.tck.InmemoryCmisRegistryFactory</value>
                        </property>
                     </systemProperties>
                     <argLine>-Xms150m -Xmx150m</argLine>
                     <testFailureIgnore>false</testFailureIgnore>
                     <skip>false</skip>
                  </configuration>
               </plugin>
            </plugins>
         </build>
      </profile>
   </profiles>
   <build>
      <plugins>
         <plugin>
            <groupId>org.jvnet.jaxb2.maven2</groupId>
            <artifactId>maven-jaxb2-plugin</artifactId>
            <version>0.6.2</version>
            <executions>
               <execution>
                  <id>generate cmis classes</id>
                  <goals>
                     <goal>generate</goal>
                  </goals>
                  <phase>generate-sources</phase>
                  <configuration>
                     <schemaDirectory>src/main/resources</schemaDirectory>
                     <catalog>src/main/resources/catalog.xml</catalog>
                     <schemaLanguage>XMLSCHEMA</schemaLanguage>
                     <extension>true</extension>
                     <schemaIncludes>
                        <include>CMIS-Core.xsd</include>
                        <include>CMIS-Messaging.xsd</include>
                        <include>CMIS-RestAtom.xsd</include>
                     </schemaIncludes>
                     <verbose>false</verbose>
                  </configuration>
               </execution>
            </executions>
         </plugin>
         <plugin>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-codegen-plugin</artifactId>
            <executions>
               <execution>
                  <id>generate sources</id>
                  <phase>generate-sources</phase>
                  <configuration>
                     <sourceRoot>${basedir}/target/generated-sources/</sourceRoot>
                     <wsdlOptions>
                        <wsdlOption>
                           <wsdl>${basedir}/src/main/resources/wsdl/CMISWS-Service.wsdl</wsdl>
                           <extraargs>
                              <extraarg>-validate</extraarg>
                              <extraarg>-b</extraarg>
                              <extraarg>${basedir}/src/main/resources/wsdl/binding.xml</extraarg>
                              <extraarg>-p</extraarg>
                              <extraarg>org.xcmis.soap</extraarg>
                              <extraarg>-nexclude</extraarg>
                              <extraarg>http://docs.oasis-open.org/ns/cmis/core/200908/=org.xcmis.core
                              </extraarg>
                              <extraarg>-nexclude</extraarg>
                              <extraarg>http://docs.oasis-open.org/ns/cmis/messaging/200908/=org.xcmis.messaging
                              </extraarg>
                           </extraargs>
                        </wsdlOption>
                     </wsdlOptions>
                  </configuration>
                  <goals>
                     <goal>wsdl2java</goal>
                  </goals>
               </execution>
            </executions>
         </plugin>
      </plugins>
   </build>

</project>
