<?xml version="1.0" encoding="UTF-8"?>

<!--
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->

<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>appfuse-light</artifactId>
    <packaging>pom</packaging>
    <name>AppFuse Light Modules</name>
    <version>3.5.0</version>

    <description>
        AppFuse Light Web Frameworks: JSF, Spring MVC, Stripes, Struts 2, Tapestry, Wicket.
    </description>

    <scm>
        <connection>scm:git:git@github.com:appfuse/appfuse-light.git</connection>
        <developerConnection>scm:git:git@github.com:appfuse/appfuse-light.git</developerConnection>
        <url>http://source.appfuse.org/browse/appfuse-light</url>
    </scm>

    <parent>
        <groupId>org.appfuse</groupId>
        <artifactId>appfuse-web</artifactId>
        <version>3.5.0</version>
    </parent>

    <issueManagement>
        <system>jira</system>
        <url>http://issues.appfuse.org/browse/EQX</url>
    </issueManagement>

    <build>
        <defaultGoal>install</defaultGoal>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.4</version>
                <configuration>
                    <releaseProfiles>create-archetype</releaseProfiles>
                </configuration>
            </plugin>
        </plugins>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.codehaus.cargo</groupId>
                    <artifactId>cargo-maven2-plugin</artifactId>
                    <configuration>
                        <deployables>
                            <deployable>
                                <properties>
                                    <context>ROOT</context>
                                </properties>
                            </deployable>
                        </deployables>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>2.18</version>
                    <configuration>
                        <includes>
                            <include>**/*WebTest.java</include>
                        </includes>
                        <systemPropertyVariables>
                            <cargo.host>${cargo.host}</cargo.host>
                            <cargo.port>${cargo.port}</cargo.port>
                        </systemPropertyVariables>
                    </configuration>
                    <executions>
                        <execution>
                            <goals>
                                <goal>integration-test</goal>
                                <goal>verify</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <configuration>
                        <excludes>
                            <exclude>**/*WebTest.java</exclude>
                        </excludes>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.jgeppert.struts2.bootstrap</groupId>
                <artifactId>struts2-bootstrap-plugin</artifactId>
                <version>2.0.1</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.apache.velocity</groupId>
                        <artifactId>velocity</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>net.sourceforge.jwebunit</groupId>
                <artifactId>jwebunit-htmlunit-plugin</artifactId>
                <version>${jwebunit.version}</version>
            </dependency>
            <dependency>
                <groupId>net.sourceforge.stripes</groupId>
                <artifactId>stripes</artifactId>
                <version>${stripes.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>log4j</groupId>
                        <artifactId>log4j</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>net.sourceforge.tapestrytestify</groupId>
                <artifactId>tapestry-testify</artifactId>
                <version>1.0.4</version>
                <scope>test</scope>
                <exclusions>
                    <exclusion>
                        <groupId>org.testng</groupId>
                        <artifactId>testng</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.apache.wicket</groupId>
                <artifactId>wicket-datetime</artifactId>
                <version>${wicket.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <modules>
        <module>jsf</module>
        <module>spring</module>
        <module>spring-freemarker</module>
        <module>spring-security</module>
        <module>stripes</module>
        <module>struts</module>
        <module>tapestry</module>
        <module>wicket</module>
    </modules>

    <properties>
        <db.name>appfuse_light_${web.framework}</db.name>
        <jwebunit.version>3.2</jwebunit.version>
        <stripes.version>1.5.8</stripes.version>
        <skipITs>false</skipITs>

        <!-- Framework dependency versions -->
        <appfuse.version>3.5.0</appfuse.version>

        <!-- Search index settings -->
        <search.index.basedir>${project.build.testOutputDirectory}</search.index.basedir>
    </properties>

    <profiles>
        <profile>
            <id>create-archetype</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <version>1.7</version>
                        <executions>
                            <execution>
                                <id>build-archetype</id>
                                <phase>package</phase>
                                <configuration>
                                    <target if="web.framework">
                                        <delete dir="target/${web.framework}archetype"/>
                                        <ant antfile="../build.xml" dir="." target="build-archetype">
                                            <property name="module" value="${web.framework}"/>
                                        </ant>
                                    </target>
                                </configuration>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>test-archetype</id>
                                <phase>verify</phase>
                                <configuration>
                                    <target if="web.framework">
                                        <ant antfile="../build.xml" dir="." target="test">
                                            <property name="archetype" value="${project.artifactId}-archetype"/>
                                        </ant>
                                    </target>
                                </configuration>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>deploy-archetype</id>
                                <phase>deploy</phase>
                                <configuration>
                                    <target if="web.framework">
                                        <ant antfile="../build.xml" dir="." target="deploy">
                                            <property name="module" value="${web.framework}"/>
                                        </ant>
                                    </target>
                                </configuration>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <!-- ================= Release Profile ==================== -->
        <profile>
            <id>release-sign-artifacts</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.5</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
