<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>com.envoisolutions.sxc</groupId>
    <artifactId>sxc</artifactId>
    <version>0.7.2</version>
  </parent>

  <artifactId>sxc-jaxb</artifactId>
  <name>SXC JAXB</name>

  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
    </license>
  </licenses>

  <dependencies>
    <dependency>
      <groupId>com.envoisolutions.sxc</groupId>
      <artifactId>sxc-runtime</artifactId>
    </dependency>

    <dependency>
      <groupId>com.envoisolutions.sxc</groupId>
      <artifactId>sxc-core</artifactId>
      <optional>true</optional>
    </dependency>

    <dependency>
      <groupId>com.sun.xml.bind</groupId>
      <artifactId>jaxb-impl</artifactId>
      <version>2.1.2</version>
      <exclusions>
        <exclusion>
          <groupId>javax.xml.stream</groupId>
          <artifactId>stax-api</artifactId>
        </exclusion>
      </exclusions>
      <optional>true</optional>
    </dependency>

    <dependency>
      <groupId>com.sun.xml.bind</groupId>
      <artifactId>jaxb-xjc</artifactId>
      <version>2.1.2</version>
      <optional>true</optional>
    </dependency>
      
    <dependency>
      <groupId>org.eclipse.jdt</groupId>
      <artifactId>core</artifactId>
      <version>3.2.0.658</version>
      <optional>true</optional>
    </dependency>

    <dependency>
      <groupId>xmlunit</groupId>
      <artifactId>xmlunit</artifactId>
      <version>1.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <phase>generate-test-sources</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <tasks>
                <taskdef classname="com.sun.tools.xjc.XJCTask" classpathref="maven.test.classpath" name="xjc" />
                <mkdir dir="${project.build.directory}/generated-source" />
                <xjc target="2.1" destdir="${basedir}/target/generated-source">
                  <schema includes="**/*.xsd" dir="${basedir}/src/test/schema" />
                </xjc>
              </tasks>
              <testSourceRoot>${project.build.directory}/generated-source</testSourceRoot>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>1.0</version>
        <executions>
          <execution>
            <id>add-test-source</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>add-test-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>${project.build.directory}/generated-source</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <configuration>
          <descriptors>
            <descriptor>assembly.xml</descriptor>
          </descriptors>
        </configuration>
        <executions>
          <execution>
            <id>make-assembly</id>
            <phase>package</phase>
            <goals>
              <goal>attached</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>