<?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.guvnor</groupId>
    <artifactId>guvnor-asset-mgmt</artifactId>
    <version>7.0.0.Beta1</version>
  </parent>

  <artifactId>guvnor-asset-mgmt-project</artifactId>
  <packaging>pom</packaging>

  <name>Guvnor - Asset Management Project</name>
  <description>Guvnor - Asset Management Project (includes processes to manage business assets)</description>

  <build>
    <resources>
      <resource>
        <directory>src/main/filtered-resources</directory>
        <filtering>true</filtering>
      </resource>
    </resources>

    <plugins>
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <executions>
          <execution>
            <id>process-resources</id>
            <goals>
              <goal>resources</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-invoker-plugin</artifactId>
        <configuration>
          <projectsDirectory>${project.build.outputDirectory}</projectsDirectory>
          <!-- No need to clone the repos, maven-resources-plugin already did the required properties filtering -->
          <localRepositoryPath>${settings.localRepository}</localRepositoryPath>
        </configuration>
        <executions>
          <execution>
            <id>build-kjar</id>
            <phase>package</phase>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-kjar-to-main-project</id>
            <phase>package</phase>
            <goals>
              <goal>attach-artifact</goal>
            </goals>
            <configuration>
              <artifacts>
                <artifact>
                  <file>${project.build.outputDirectory}/kjar/target/${project.artifactId}-${project.version}.jar</file>
                  <type>jar</type>
                </artifact>
              </artifacts>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

</project>