<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>build-scripts</artifactId>
  <packaging>pom</packaging>
  <name>build-scripts</name>
  <parent>
    <groupId>org.quattor.maven</groupId>
    <artifactId>maven</artifactId>
    <version>1.52</version>
  </parent>
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <prove.args>-q</prove.args>
    <unittest />
  </properties>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <extensions>true</extensions>
        <executions>
          <execution>
            <id>assemblies</id>
            <phase>package</phase>
            <goals>
              <goal>attached</goal>
            </goals>
            <configuration>
              <descriptors>
                <descriptor>src/main/assembly/scripts.xml</descriptor>
              </descriptors>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>build-script-test</id>
      <activation>
        <property>
          <name>env.PERL5LIB</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>prove</id>
                <phase>test</phase>
                <goals>
                  <goal>exec</goal>
                </goals>
                <configuration>
                  <executable>prove</executable>
                  <workingDirectory>${basedir}</workingDirectory>
                  <arguments>
                    <argument>-I</argument>
                    <argument>src/main/perl</argument>
                    <argument>-I</argument>
                    <argument>src/test/perl</argument>
                    <argument>${prove.args}</argument>
                    <argument>-I</argument>
                    <argument>${project.build.directory}/dependency/build-scripts/</argument>
                    <argument>src/test/perl/${unittest}</argument>
                  </arguments>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
