<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>de.eonas.portal.parentpoms</groupId>
    <artifactId>webapp</artifactId>
    <packaging>pom</packaging>
    <version>1.2.1</version>
    <name>Pom for a webapp on RHEL6</name>

    <parent>
        <groupId>de.eonas.portal.parentpoms</groupId>
        <artifactId>root</artifactId>
        <version>1.2.1</version>
        <relativePath>..</relativePath>
    </parent>

    <properties>
        <tomcat.home>/var/lib/tomcat6</tomcat.home>
        <app.home>${tomcat.home}/webapps/${project.build.finalName}</app.home>
    </properties>

    <build>
        <finalName>${project.artifactId}</finalName>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.1.1</version>
            </plugin>
        </plugins>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>rpm-maven-plugin</artifactId>
                    <version>2.1-alpha-1</version>
                    <executions>
                        <execution>
                            <id>mainpackage</id>
                            <configuration>
                                <name>${project.artifactId}</name>
                                <copyright>2012, eonas GmbH</copyright>
                                <group>Development</group>
                                <description>Maven Recipe: RPM Package.</description>
                                <requires>
                                    <require>tomcat6</require>
                                </requires>
                                <mappings>
                                    <mapping>
                                        <directory>${app.home}</directory>
                                        <sources>
                                            <source>
                                                <location>${project.build.directory}/${project.build.finalName}
                                                </location>
                                            </source>
                                        </sources>
                                    </mapping>
                                </mappings>
                                <keyname>Hudson Build Host</keyname>
                                <keyPassphrase>
                                    <passphrase>123456</passphrase>
                                </keyPassphrase>
                                <preinstallScriptlet>
                                    <script>
rm -fr /var/cache/tomcat6/work/Catalina/localhost/${project.build.finalName}
                                    </script>
                                </preinstallScriptlet>
                            </configuration>
                            <goals>
                                <goal>attached-rpm</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <dependencies>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jstl</artifactId>
            <version>1.2</version>
            <type>jar</type>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.5</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.8.2</version>
            <type>jar</type>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet.jsp</groupId>
            <artifactId>jsp-api</artifactId>
            <version>2.1</version>
            <type>jar</type>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <modules>
        <module>portlet</module>
        <module>opencmswebapp</module>
        <module>portlet-1.0</module>
        <module>portlet-2.0</module>
        <module>portlet-primefaces</module>
    </modules>

</project>
