<?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/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.bedework</groupId>
    <artifactId>bw-calws-soap</artifactId>
    <version>6.0.0</version>
  </parent>

  <artifactId>bw-calws-soap-xml-source</artifactId>
  <packaging>pom</packaging>
  <name>Bedework: XML source for calws-soap</name>

  <properties>
    <destDir>${project.build.directory}/sources</destDir>

    <sourceDir>${project.basedir}/../bw-calws-soap-xml/src/main/</sourceDir>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.bedework</groupId>
      <artifactId>bw-icalendar-xml</artifactId>
      <type>zip</type>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <!-- First copy the source -->
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <executions>
          <execution>
            <id>copy-resources</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${destDir}</outputDirectory>
              <resources>
                <resource>
                  <directory>${sourceDir}</directory>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <!-- Now copy in the dependencies -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>

        <executions>
          <execution>
            <id>copy-and-unpack-icalendar</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>unpack-dependencies</goal>
            </goals>
            <configuration>
              <includeGroupIds>org.bedework</includeGroupIds>
              <includeArtifactIds>bw-icalendar-xml</includeArtifactIds>
              <includeTypes>zip</includeTypes>

              <outputDirectory>${destDir}/xsd</outputDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
      </plugin>
    </plugins>
  </build>

</project>