<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>
    <parent>
        <groupId>com.legsem.legstar</groupId>
        <artifactId>legstar-transport</artifactId>
        <version>1.5.2</version>
    </parent>
    <artifactId>legstar-engine</artifactId>
    <name>LegStar Connection pooling engine</name>
    <description>Mainframe connection pooling engine.</description>

    <dependencies>
    
        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
        </dependency>

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
        </dependency>

        <dependency>
            <groupId>org.apache.geronimo.specs</groupId>
            <artifactId>geronimo-commonj_1.1_spec</artifactId>
        </dependency>

        <dependency>
            <groupId>com.legsem.legstar</groupId>
            <artifactId>legstar-coxbapi</artifactId>
        </dependency>
    
        <dependency>
            <groupId>com.legsem.legstar</groupId>
            <artifactId>legstar-messaging</artifactId>
        </dependency>
        
        <dependency>
            <groupId>com.legsem.legstar</groupId>
            <artifactId>legstar-config</artifactId>
        </dependency>
        
        <dependency>
            <groupId>com.legsem.legstar</groupId>
            <artifactId>legstar-cmockrt</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.legsem.legstar</groupId>
            <artifactId>legstar-coxbrt</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.legsem.legstar</groupId>
            <artifactId>legstar-jaxbgen</artifactId>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>
        
    </dependencies>
    
    <build>
        <plugins>
        
            <!-- Assembly generation plugin. Put the result in the source site
            so that it gets uploaded with the site.  -->
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <configuration>
                    <descriptors>
                        <descriptor>src/assemble/distribution.xml</descriptor>
                    </descriptors>
                </configuration>
                <executions>
                    <execution>
                        <id>make-assembly</id> <!-- this is used for inheritance merges -->
                        <phase>package</phase> <!-- append to the packaging phase. -->
                        <goals>
                            <goal>attached</goal> <!-- goals == mojos -->
                        </goals>
                    </execution>
                </executions>
            </plugin>
            
            <plugin>
            
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>

                    <!-- This will generate a war file for the engine servlet initator.  -->
                    <execution>
                        <id>build-war</id>
                        <phase>prepare-package</phase>
                        <configuration>
                            <tasks>
                                <ant antfile="${basedir}/src/main/ant/build-war.xml" />
                            </tasks>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                    
                    <!-- This will check that the distribution file is valid. -->
                    <execution>
                        <id>build-sample</id>
                        <phase>integration-test</phase>
                        <configuration>
                            <tasks>
                                <ant antfile="${basedir}/src/main/ant/test-distribution.xml" />
                            </tasks>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>

                    <!-- Generate site files that needs automatic update. -->
                    <execution>
                        <id>build-site</id>
                        <phase>pre-site</phase>
                        <configuration>
                            <tasks>
                                <ant antfile="${basedir}/../src/main/ant/gen-download-xml.xml">
                                    <property name="productID" value="${pom.artifactId}" />
                                    <property name="productName" value="${pom.name}" />
                                    <property name="legstarVersion" value="${parent.version}" />
                                </ant>
                            </tasks>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>

                </executions>
            </plugin>
        
            <!-- Attach the war file to Maven so that other modules can retrieve it. -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>1.5</version>
                <executions>
                    <execution>
                        <id>attach-artifacts</id>
                        <phase>package</phase>
                        <goals>
                            <goal>attach-artifact</goal>
                        </goals>
                        <configuration>
                            <artifacts>
                                <artifact>
                                    <file>${basedir}/target/legstar-engine.war</file>
                                    <type>war</type>
                                </artifact>
                            </artifacts>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

        </plugins>
    </build>
    
</project>