<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.overlord.sramp</groupId>
    <artifactId>s-ramp</artifactId>
    <version>0.4.0.Final</version>
    <relativePath>../pom.xml</relativePath>
  </parent>

  <artifactId>s-ramp-installer</artifactId>
  <name>S-RAMP Installer</name>
  <description>Scripts to install to an Application Server</description>

  <dependencies>
    <!-- Overlord Commons -->
    <dependency>
      <groupId>org.overlord</groupId>
      <artifactId>overlord-commons-installer</artifactId>
      <version>${overlord-commons.version}</version>
    </dependency>
    <dependency>
      <groupId>org.overlord</groupId>
      <artifactId>overlord-commons-services</artifactId>
    </dependency>
    <dependency>
      <groupId>org.overlord</groupId>
      <artifactId>overlord-commons-auth</artifactId>
    </dependency>
    <dependency>
      <groupId>org.overlord</groupId>
      <artifactId>overlord-commons-auth-tomcat7</artifactId>
    </dependency>
    <dependency>
      <groupId>org.overlord</groupId>
      <artifactId>overlord-commons-auth-jboss7</artifactId>
    </dependency>
    <dependency>
      <groupId>org.overlord</groupId>
      <artifactId>overlord-commons-idp-eap61</artifactId>
      <version>${overlord-commons.version}</version>
      <type>war</type>
    </dependency>
    <dependency>
      <groupId>org.overlord</groupId>
      <artifactId>overlord-commons-idp-tomcat7</artifactId>
      <version>${overlord-commons.version}</version>
      <type>war</type>
    </dependency>
    
    <!-- S-RAMP -->
    <dependency>
      <groupId>org.overlord.sramp</groupId>
      <artifactId>s-ramp-server-tomcat7</artifactId>
      <version>${project.version}</version>
      <type>war</type>
    </dependency>
    <dependency>
      <groupId>org.overlord.sramp</groupId>
      <artifactId>s-ramp-server-eap61</artifactId>
      <version>${project.version}</version>
      <type>war</type>
    </dependency>
    <dependency>
      <groupId>org.overlord.sramp</groupId>
      <artifactId>s-ramp-ui-war-tomcat7</artifactId>
      <version>${project.version}</version>
      <type>war</type>
    </dependency>
    <dependency>
      <groupId>org.overlord.sramp</groupId>
      <artifactId>s-ramp-ui-war-eap61</artifactId>
      <version>${project.version}</version>
      <type>war</type>
    </dependency>
  </dependencies>

  <profiles>
    <!-- ***************************************** -->
    <!-- Profile to *test* installing into EAP 6.1 -->
    <!-- ***************************************** -->
    <profile>
      <id>test-install-eap61</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-antrun-plugin</artifactId>
            <dependencies>
              <dependency>
                <groupId>ant</groupId>
                <artifactId>ant-trax</artifactId>
                <version>1.6.5</version>
              </dependency>
              <dependency>
                <groupId>xalan</groupId>
                <artifactId>xalan</artifactId>
                <version>2.7.1</version>
              </dependency>
            </dependencies>
            <executions>
              <execution>
                <id>install-eap61</id>
                <phase>install</phase>
                <configuration>
                  <tasks>
                    <property name="appserver.id" value="jboss-eap-6.1" />
                    <property name="s-ramp.install.dir" value="${project.build.directory}" />
                    <property name="s-ramp.appserver.dir" location="${s-ramp.install.dir}/${appserver.id}" />

                    <!-- Overlord Commons Installer and Dependencies -->
                    <property name="s-ramp.overlord-commons.installer.jar" value="${maven.dependency.org.overlord.overlord-commons-installer.jar.path}" />
                    <property name="overlord-commons.idp.file" value="${maven.dependency.org.overlord.overlord-commons-idp-eap61.war.path}" />
                    <property name="overlord-commons.services.file" value="${maven.dependency.org.overlord.overlord-commons-services.jar.path}" />
                    <property name="overlord-commons.auth.file" value="${maven.dependency.org.overlord.overlord-commons-auth.jar.path}" />
                    <property name="overlord-commons.auth.tomcat7.file" value="${maven.dependency.org.overlord.overlord-commons-auth-tomcat7.jar.path}" />
                    <property name="overlord-commons.auth.jboss7.file" value="${maven.dependency.org.overlord.overlord-commons-auth-jboss7.jar.path}" />

                    <!-- S-RAMP WARs -->
                    <property name="s-ramp.s-ramp-server.war.path" value="${maven.dependency.org.overlord.sramp.s-ramp-server-eap61.war.path}" />
                    <property name="s-ramp.s-ramp-ui.war.path" value="${maven.dependency.org.overlord.sramp.s-ramp-ui-war-eap61.war.path}" />

                    <!-- ModeShape Distribution -->
                    <property name="s-ramp.modeshape-distribution.zip.path" value="${maven.dependency.org.modeshape.modeshape-distribution.jbosseap-61-dist.zip.path}" />

                    <property file="build.properties" />
                    <property name="s-ramp.appserver.zip" value="${basedir}/jboss-eap-6.1.0.zip" />
                    <unzip src="${s-ramp.appserver.zip}" dest="${s-ramp.install.dir}" overwrite="false" />
                    <chmod perm="a+x" dir="${s-ramp.appserver.dir}">
                      <include name="*.sh" />
                    </chmod>

                    <ant dir="${basedir}/src/main/resources" antfile="${basedir}/src/main/resources/build.xml">
                      <target name="install" />
                    </ant>
                  </tasks>
                </configuration>
                <goals>
                  <goal>run</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
      <dependencies>
        <dependency>
          <groupId>org.modeshape</groupId>
          <artifactId>modeshape-distribution</artifactId>
          <version>${org.modeshape.version}</version>
          <type>zip</type>
          <classifier>jbosseap-61-dist</classifier>
        </dependency>
      </dependencies>
    </profile>
    <!-- ****************************************** -->
    <!-- Profile to *test* installing into Tomcat 7 -->
    <!-- ****************************************** -->
    <profile>
      <id>test-install-tomcat7</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-antrun-plugin</artifactId>
            <dependencies>
              <dependency>
                <groupId>ant</groupId>
                <artifactId>ant-trax</artifactId>
                <version>1.6.5</version>
              </dependency>
              <dependency>
                <groupId>xalan</groupId>
                <artifactId>xalan</artifactId>
                <version>2.7.1</version>
              </dependency>
            </dependencies>
            <executions>
              <execution>
                <id>install-tomcat7</id>
                <phase>install</phase>
                <configuration>
                  <tasks>
                    <property name="appserver.id" value="tomcat-7" />
                    <property name="s-ramp.install.dir" value="${project.build.directory}" />
                    <property name="s-ramp.appserver.dir" location="${s-ramp.install.dir}/apache-tomcat-7.0.52" />

                    <!-- Overlord Commons Installer and Dependencies -->
                    <property name="s-ramp.overlord-commons.installer.jar" value="${maven.dependency.org.overlord.overlord-commons-installer.jar.path}" />
                    <property name="overlord-commons.idp.file" value="${maven.dependency.org.overlord.overlord-commons-idp-tomcat7.war.path}" />
                    <property name="overlord-commons.services.file" value="${maven.dependency.org.overlord.overlord-commons-services.jar.path}" />
                    <property name="overlord-commons.auth.file" value="${maven.dependency.org.overlord.overlord-commons-auth.jar.path}" />
                    <property name="overlord-commons.auth.tomcat7.file" value="${maven.dependency.org.overlord.overlord-commons-auth-tomcat7.jar.path}" />

                    <!-- S-RAMP WARs -->
                    <property name="s-ramp.s-ramp-server.war.path" value="${maven.dependency.org.overlord.sramp.s-ramp-server-tomcat7.war.path}" />
                    <property name="s-ramp.s-ramp-ui.war.path" value="${maven.dependency.org.overlord.sramp.s-ramp-ui-war-tomcat7.war.path}" />

                    <property file="build.properties" />
                    <property name="s-ramp.install.dir" value="${project.build.directory}" />
                    <property name="s-ramp.appserver.zip" value="${basedir}/apache-tomcat-7.0.52.zip" />
                    <unzip src="${s-ramp.appserver.zip}" dest="${s-ramp.install.dir}" overwrite="false" />
                    <chmod perm="a+x" dir="${s-ramp.appserver.dir}/bin">
                      <include name="*.sh" />
                    </chmod>

                    <ant dir="${basedir}/src/main/resources" antfile="${basedir}/src/main/resources/build.xml">
                      <target name="install" />
                    </ant>
                  </tasks>
                </configuration>
                <goals>
                  <goal>run</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
      <dependencies>
        <dependency>
          <groupId>org.modeshape</groupId>
          <artifactId>modeshape-distribution</artifactId>
          <version>3.1.3.Final</version>
          <type>zip</type>
          <classifier>jbossas-71-dist</classifier>
        </dependency>
      </dependencies>
    </profile>
  </profiles>
</project>
