<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>
    <groupId>com.iona.fuse</groupId>
    <artifactId>${product.name}-installer-tomcat</artifactId>
    <version>${product.version}</version>
    <name>${product.name} Installer - Tomcat</name>
    <url></url>

    <parent>
        <groupId>com.iona.fuse</groupId>
        <artifactId>installer</artifactId>
        <version>1.8.18</version>
    </parent>

    <packaging>pom</packaging>

    <build>
        <plugins>
            <!-- Download into target directory -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>get_tomcat_bin</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}</outputDirectory>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>tomcat</groupId>
                                    <artifactId>tomcat-distribution</artifactId>
                                    <version>${tomcat.version}</version>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <!-- Copy only what we want into the stage-bin directory --> 
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <executions>
                    <execution>
                        <id>stage-bin</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>directory-single</goal>
                        </goals>
                        <configuration>
                            <descriptors>
                                <descriptor>assembly/stage-bin.xml</descriptor>                                
                            </descriptors>
                            <finalName>stage</finalName>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
 
            <!-- Fix line endings -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <id>fix-line-endings</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <tasks>
                                <fixcrlf srcdir="target/stage-bin.dir" includes="${line.ending.includes}" eol="${line.ending}"/>
                            </tasks>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
