<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-distro</artifactId>
    <version>0.4.0.Final</version>
    <relativePath>../pom.xml</relativePath>
  </parent>
  <artifactId>s-ramp-distro-assembly</artifactId>
  <packaging>pom</packaging>
  <name>S-RAMP Distribution: Assembly</name>
  <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-jboss7</artifactId>
    </dependency>
    <dependency>
      <groupId>org.overlord</groupId>
      <artifactId>overlord-commons-auth-tomcat7</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 Installer -->
    <dependency>
      <groupId>org.overlord.sramp</groupId>
      <artifactId>s-ramp-installer</artifactId>
      <version>${project.version}</version>
    </dependency>

    <!-- S-RAMP Demos -->
    <dependency>
      <groupId>org.overlord.sramp.demos</groupId>
      <artifactId>s-ramp-demos-assembly</artifactId>
      <version>${project.version}</version>
      <type>zip</type>
    </dependency>

    <!-- S-RAMP WARs -->
    <dependency>
      <groupId>org.overlord.sramp</groupId>
      <artifactId>s-ramp-server-tomcat7</artifactId>
      <type>war</type>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.overlord.sramp</groupId>
      <artifactId>s-ramp-server-eap61</artifactId>
      <type>war</type>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.overlord.sramp</groupId>
      <artifactId>s-ramp-ui-war-tomcat7</artifactId>
      <type>war</type>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.overlord.sramp</groupId>
      <artifactId>s-ramp-ui-war-eap61</artifactId>
      <type>war</type>
      <version>${project.version}</version>
    </dependency>

    <!-- S-RAMP Sources -->
    <dependency>
      <groupId>org.overlord.sramp</groupId>
      <artifactId>s-ramp-api</artifactId>
      <version>${project.version}</version>
      <classifier>sources</classifier>
    </dependency>
    <dependency>
      <groupId>org.overlord.sramp</groupId>
      <artifactId>s-ramp-atom</artifactId>
      <version>${project.version}</version>
      <classifier>sources</classifier>
    </dependency>
    <dependency>
      <groupId>org.overlord.sramp</groupId>
      <artifactId>s-ramp-client</artifactId>
      <version>${project.version}</version>
      <classifier>sources</classifier>
    </dependency>
    <dependency>
      <groupId>org.overlord.sramp</groupId>
      <artifactId>s-ramp-common</artifactId>
      <version>${project.version}</version>
      <classifier>sources</classifier>
    </dependency>
    <dependency>
      <groupId>org.overlord.sramp</groupId>
      <artifactId>s-ramp-repository</artifactId>
      <version>${project.version}</version>
      <classifier>sources</classifier>
    </dependency>
    <dependency>
      <groupId>org.overlord.sramp</groupId>
      <artifactId>s-ramp-repository-jcr</artifactId>
      <version>${project.version}</version>
      <classifier>sources</classifier>
    </dependency>
    <dependency>
      <groupId>org.overlord.sramp</groupId>
      <artifactId>s-ramp-repository-jcr-modeshape</artifactId>
      <version>${project.version}</version>
      <classifier>sources</classifier>
    </dependency>
    <dependency>
      <groupId>org.overlord.sramp</groupId>
      <artifactId>s-ramp-server</artifactId>
      <version>${project.version}</version>
      <classifier>sources</classifier>
    </dependency>
    <dependency>
      <groupId>org.overlord.sramp</groupId>
      <artifactId>s-ramp-shell</artifactId>
      <version>${project.version}</version>
      <classifier>sources</classifier>
    </dependency>
    <dependency>
      <groupId>org.overlord.sramp</groupId>
      <artifactId>s-ramp-shell-api</artifactId>
      <version>${project.version}</version>
      <classifier>sources</classifier>
    </dependency>
    <dependency>
      <groupId>org.overlord.sramp</groupId>
      <artifactId>s-ramp-wagon</artifactId>
      <version>${project.version}</version>
      <classifier>sources</classifier>
    </dependency>
    <dependency>
      <groupId>org.overlord.sramp</groupId>
      <artifactId>s-ramp-ui-war</artifactId>
      <version>${project.version}</version>
      <classifier>sources</classifier>
    </dependency>

    <!-- S-RAMP documentation (jdocbook) -->
    <dependency>
      <groupId>org.overlord.sramp</groupId>
      <artifactId>sramp-wiki</artifactId>
      <version>${s-ramp-wiki.version}</version>
      <type>jdocbook</type>
    </dependency>

    <!-- ModeShape Distro -->
    <dependency>
      <groupId>org.modeshape</groupId>
      <artifactId>modeshape-distribution</artifactId>
      <version>${org.modeshape.version}</version>
      <classifier>jbosseap-61-dist</classifier>
      <type>zip</type>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <dependencies>
          <dependency>
            <!-- Entry needed to enable jdocbook unzipping -->
            <groupId>org.jboss.maven.plugins</groupId>
            <artifactId>maven-jdocbook-plugin</artifactId>
            <version>2.3.8</version>
          </dependency>
        </dependencies>
        <executions>
          <execution>
            <id>make-dist</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <finalName>s-ramp-${project.version}</finalName>
              <attach>true</attach>
              <descriptors>
                <descriptor>src/main/assembly/dist.xml</descriptor>
              </descriptors>
              <tarLongFileMode>gnu</tarLongFileMode>
              <appendAssemblyId>false</appendAssemblyId>
              <archiverConfig>
                <defaultDirectoryMode>0755</defaultDirectoryMode>
              </archiverConfig>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <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>
            <version>1.7</version>
            <dependencies>
              <dependency>
                <groupId>ant</groupId>
                <artifactId>ant-trax</artifactId>
                <version>1.6.5</version>
              </dependency>
            </dependencies>
            <executions>
              <execution>
                <id>install-eap61</id>
                <phase>install</phase>
                <configuration>
                  <tasks>
                    <property name="overlord-commons.idp.download.url" value="file:///${maven.dependency.org.overlord.overlord-commons-idp-eap61.war.path}" />
                    <property name="overlord-commons.auth.download.url" value="file:///${maven.dependency.org.overlord.overlord-commons-auth.jar.path}" />

                    <ant dir="${basedir}/src/main/resources/ROOT" antfile="${basedir}/src/main/resources/ROOT/build.xml">
                      <target name="install" />
                    </ant>
                  </tasks>
                </configuration>
                <goals>
                  <goal>run</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <!-- ****************************************** -->
    <!-- Profile to *test* installing into Tomcat 7 -->
    <!-- ****************************************** -->
    <profile>
      <id>test-install-tomcat7</id>
      <dependencies>
        <dependency>
          <groupId>org.overlord</groupId>
          <artifactId>overlord-commons-auth</artifactId>
          <version>${project.version}</version>
        </dependency>
        <dependency>
          <groupId>org.overlord</groupId>
          <artifactId>overlord-commons-auth-tomcat7</artifactId>
          <version>${project.version}</version>
        </dependency>
        <dependency>
          <groupId>org.overlord</groupId>
          <artifactId>overlord-commons-idp-tomcat7</artifactId>
          <version>${project.version}</version>
          <type>war</type>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-antrun-plugin</artifactId>
            <version>1.7</version>
            <dependencies>
              <dependency>
                <groupId>ant</groupId>
                <artifactId>ant-trax</artifactId>
                <version>1.6.5</version>
              </dependency>
            </dependencies>
            <executions>
              <execution>
                <id>install-eap61</id>
                <phase>install</phase>
                <configuration>
                  <tasks>
                    <unzip src="apache-tomcat-7.0.47.zip" dest="${project.build.directory}" overwrite="false" />
                    <property name="appserver.id" value="tomcat-7" />
                    <property name="overlord-commons.install.dir" value="${project.build.directory}" />
                    <property name="overlord-commons.appserver.dir" location="${project.build.directory}/apache-tomcat-7.0.47" />

                    <!-- Overlord Commons Installer and Dependencies -->
                    <property name="overlord-commons.idp.download.url" value="file:///${maven.dependency.org.overlord.overlord-commons-idp-tomcat7.war.path}" />
                    <property name="overlord-commons.lib.overlord-commons-auth.download.url" value="file:///${maven.dependency.org.overlord.overlord-commons-auth.jar.path}" />
                    <property name="overlord-commons.lib.overlord-commons-auth-tomcat7.download.url" value="file:///${maven.dependency.org.overlord.overlord-commons-auth-tomcat7.jar.path}" />

                    <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>
    </profile>
  </profiles>
  
</project>
