<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>

  <groupId>${artifact.groupId}</groupId>
  <artifactId>${artifact.artifactId}-krad-conv</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>${artifact.type}</packaging>

  <name>${app}-krad-conv</name>
  <url>http://maven.apache.org</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>
    <!-- war dependency for war overlay -->
    <dependency>
      <artifactId>${parent.artifactId}</artifactId>
      <groupId>${parent.groupId}</groupId>
      <version>${parent.version}</version>
      <type>${parent.type}</type>
    </dependency>
    <!-- pom dependency included for any class-related dependencies -->
    <% for(dependency in dependencies) { %><dependency>
      <artifactId>${dependency.artifactId}</artifactId>
      <groupId>${dependency.groupId}</groupId>
      <version>${dependency.version}</version><% if(dependency.type) { %>
      <type>${dependency.type}</type><% } %><% if(dependency.classifier) { %>
      <classifier>${dependency.classifier}</classifier><% } %>
    </dependency><% } %>
    <% for(systemlib in systemlibs) { %>
    <dependency>
      <artifactId>${systemlib.artifactId}</artifactId>
      <groupId>${systemlib.groupId}</groupId>
      <version>${systemlib.version}</version>
      <type>system</type>
      <systemPath>${systemlib.systemPath}</systemPath>
    </dependency>
    <% } %>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.10</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <repositories>
    <repository>
      <id>kuali</id>
      <name>Kuali Repository</name>
      <url>https://test.kuali.org/maven</url>
      <snapshots><enabled>true</enabled></snapshots>
    </repository>
    <repository>
      <id>codehaus</id>
      <name>Codehaus</name>
      <url>http://dist.codehaus.org</url>
    </repository>
    <repository>
      <id>apache</id>
      <name>apache</name>
      <url>http://people.apache.org/repo/m2-ibiblio-rsync-repository</url>
    </repository>
    <repository>
      <id>atlassian</id>
      <name>atlassian</name>
      <url>http://maven.atlassian.com/repository/public</url>
    </repository>
    <repository>
      <snapshots />
      <id>maven-repo1</id>
      <name>maven2 repo</name>
      <url>http://repo1.maven.org/maven2</url>
    </repository>

  </repositories>

  <build>
    <resources>
      <resource>
        <directory>\${basedir}/src/main/resources</directory>
      </resource>
      <resource>
        <directory>\${project.build.directory}/generated-resources/WEB-INF</directory>
        <filtering>true</filtering>
      </resource>
    </resources>
    <plugins><% if("war".equals(artifact.type)) { %>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <additionalClasspathElements>
            <additionalClasspathElement>\${project.build.directory}/generated-resources/WEB-INF/classes</additionalClasspathElement>
          </additionalClasspathElements>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.1.1</version>
        <configuration>
          <overlays>
            <overlay>
              <groupId>${artifact.groupId}</groupId>
              <artifactId>${artifact.artifactId}</artifactId>
            </overlay>
          </overlays>
        </configuration>
        </plugin><% } %>
      <!-- added unpack to provide access to all resources/classes -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>2.7</version>
        <executions>
          <execution>
            <id>unpack-dependencies</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>unpack-dependencies</goal>
            </goals>
            <!-- include any classes generated in war -->
            <configuration>
              <overlays>
                <overlay>
                  <groupId>${artifact.groupId}</groupId>
                  <artifactId>${artifact.artifactId}</artifactId></overlay>
                <overlay>
                  <!-- empty groupId/artifactId represents the current build -->
                </overlay>
              </overlays>
              <outputDirectory>\${project.build.directory}</outputDirectory>
              <includeTypes>war</includeTypes>
              <includes>WEB-INF/classes/**/*.class</includes>
              <includeArtifactIds>${artifact.artifactId}</includeArtifactIds>
              <excludeTransitive>true</excludeTransitive>
              <!--use as much as needed to be specific...also scope,type,classifier etc-->
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>