<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.eximeebpms.bpm</groupId>
    <artifactId>eximeebpms-database-settings</artifactId>
    <relativePath>../../database</relativePath>
    <version>1.1.1</version>
  </parent>

  <artifactId>license-book</artifactId>
  <packaging>pom</packaging>

  <name>EximeeBPMS - License Book</name>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.eximeebpms.bpm</groupId>
        <artifactId>eximeebpms-core-internal-dependencies</artifactId>
        <version>${project.version}</version>
        <scope>import</scope>
        <type>pom</type>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <build>
    <plugins>

      <!-- assemble zip artifact -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <executions>
          <execution>
            <id>assemble</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <descriptors>
                <descriptor>assembly.xml</descriptor>
              </descriptors>
              <attach>true</attach>
              <appendAssemblyId>false</appendAssemblyId>
              <outputDirectory>target/</outputDirectory>
              <workDirectory>target/assembly/work</workDirectory>
              <tarLongFileMode>gnu</tarLongFileMode>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <!-- copy book to target directory -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <id>copy-license-book</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <target>
                <copy todir="target/">
                  <fileset dir="src/main/resources">
                    <include name="**/*.txt" />
                  </fileset>
                </copy>
              </target>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <!-- attach artifact -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-artifacts</id>
            <phase>package</phase>
            <goals>
              <goal>attach-artifact</goal>
            </goals>
            <configuration>
              <artifacts>
                <artifact>
                  <file>target/license-book.txt</file>
                  <type>txt</type>
                </artifact>
              </artifacts>
            </configuration>
          </execution>
        </executions>
      </plugin>

    </plugins>
  </build>

</project>
