<!--
  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-rt-databinding-xmlbeans</artifactId>
    <packaging>jar</packaging>
    <name>Apache CXF Runtime XmlBeans DataBinding</name>
    <description>Apache CXF Runtime XmlBeans DataBinding</description>
    <url>http://cxf.apache.org</url>

    <parent>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-parent</artifactId>
        <version>2.6.6.jbossorg-1</version>
        <relativePath>../../../parent/pom.xml</relativePath>
    </parent>

    <properties>
        <cxf.spi-dir>spi-2.1</cxf.spi-dir>
        <cxf.osgi.import>
            !repackage
        </cxf.osgi.import>
    </properties>
    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-api</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-core</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-tools-common</artifactId>
            <version>${project.version}</version>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-tools-wsdlto-core</artifactId>
            <version>${project.version}</version>
            <scope>provided</scope>
            <optional>true</optional>
        </dependency>


        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-testutils</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.xmlbeans</groupId>
            <artifactId>xmlbeans</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>stax</groupId>
                    <artifactId>stax-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-transports-local</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-transports-http-jetty</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-frontend-jaxws</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
	    <groupId>org.slf4j</groupId>
	    <artifactId>slf4j-jdk14</artifactId>
	    <scope>test</scope>
	</dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>


    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>xmlbeans-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>xmlbeans-test</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <schemaDirectory>src/test/xsd</schemaDirectory>
                    <sourceGenerationDirectory>${project.build.directory}/generated/src/test/java</sourceGenerationDirectory>
                    <classGenerationDirectory>${project.build.directory}/generated/src/test/resources</classGenerationDirectory>
                    <!--noJavac>true</noJavac-->
                    <javaSource>1.5</javaSource>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-codegen-plugin</artifactId>
                <version>${project.version}</version>
                <executions>
                    <execution>
                        <id>generate-test-sources</id>
                        <phase>generate-test-sources</phase>
                        <configuration>
                            <fork>${cxf.codegenplugin.forkmode}</fork>
                            <testSourceRoot>target/generated/src/test/java</testSourceRoot>
                            <testWsdlRoot>src/test/resources/wsdl</testWsdlRoot>
                            <wsdlOptions>
                                <wsdlOption>
                                    <wsdl>src/test/resources/wsdl/xmlbeanstest.wsdl</wsdl>
                                    <dataBinding>xmlbeans</dataBinding>
                                    <extraargs>
                                        <arg>-classdir</arg>
                                        <arg>${basedir}/target/generated/src/test/resources</arg>
                                    </extraargs>
                                </wsdlOption>
                            </wsdlOptions>
                        </configuration>
                        <goals>
                            <goal>wsdl2java</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>jdk15</id>
            <activation>
                <jdk>1.5</jdk>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>org.apache.geronimo.specs</groupId>
                    <artifactId>geronimo-stax-api_1.0_spec</artifactId>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>setup.eclipse</id>
            <build>
                <defaultGoal>process-test-sources</defaultGoal>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>setup.eclipse.project.sdo</id>
                                <phase>process-test-sources</phase>
                                <configuration>
                                    <target>
                                        <!-- XmlBeans generated code uses raw List types -->
                                        <propertyfile file="${basedir}/.settings/org.eclipse.jdt.core.prefs">
                                            <entry key="org.eclipse.jdt.core.compiler.problem.rawTypeReference" value="ignore" />
                                        </propertyfile>
                                    </target>
                                </configuration>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
