<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.artificer</groupId>
    <artifactId>artificer</artifactId>
    <version>1.0.0.Alpha1</version>
    <relativePath>../pom.xml</relativePath>
  </parent>

  <artifactId>artificer-installer</artifactId>
  <name>Artificer Installer</name>
  <description>Scripts to install to an Application Server</description>

  <dependencies>
    <!-- Overlord Commons -->
    <dependency>
      <groupId>org.overlord</groupId>
      <artifactId>overlord-commons-services</artifactId>
    </dependency>
    
    <!-- Artificer -->
    <dependency>
      <groupId>org.artificer</groupId>
      <artifactId>artificer-server-eap6</artifactId>
      <type>war</type>
    </dependency>
    <dependency>
      <groupId>org.artificer</groupId>
      <artifactId>artificer-server-wildfly8</artifactId>
      <type>war</type>
    </dependency>
    <dependency>
      <groupId>org.artificer</groupId>
      <artifactId>artificer-ui-eap6</artifactId>
      <type>war</type>
    </dependency>
    <dependency>
      <groupId>org.artificer</groupId>
      <artifactId>artificer-ui-wildfly8</artifactId>
      <type>war</type>
    </dependency>
  </dependencies>

  <profiles>
    <!-- ***************************************** -->
    <!-- Profile to *test* installing into Wildfly 8 -->
    <!-- ***************************************** -->
    <profile>
      <id>test-install-wildfly8</id>
      <dependencyManagement>
        <dependencies>
          <dependency>
            <groupId>org.modeshape</groupId>
            <artifactId>modeshape-distribution</artifactId>
            <version>${version.org.modeshape}</version>
            <type>zip</type>
            <classifier>jboss-wf8-dist</classifier>
          </dependency>
        </dependencies>
      </dependencyManagement>
      <dependencies>
        <dependency>
          <groupId>org.modeshape</groupId>
          <artifactId>modeshape-distribution</artifactId>
          <type>zip</type>
          <classifier>jboss-wf8-dist</classifier>
        </dependency>
        <dependency>
          <groupId>org.keycloak</groupId>
          <artifactId>keycloak-war-dist-all</artifactId>
          <type>zip</type>
          <exclusions>
            <exclusion>
              <groupId>org.keycloak</groupId>
              <artifactId>keycloak-as7-adapter-dist</artifactId>
            </exclusion>
            <exclusion>
              <groupId>org.keycloak</groupId>
              <artifactId>keycloak-jetty81-adapter-dist</artifactId>
            </exclusion>
            <exclusion>
              <groupId>org.keycloak</groupId>
              <artifactId>keycloak-jetty91-adapter-dist</artifactId>
            </exclusion>
            <exclusion>
              <groupId>org.keycloak</groupId>
              <artifactId>keycloak-jetty92-adapter-dist</artifactId>
            </exclusion>
            <exclusion>
              <groupId>org.keycloak</groupId>
              <artifactId>keycloak-example-themes-dist</artifactId>
            </exclusion>
          </exclusions>
        </dependency>
        <dependency>
          <groupId>org.keycloak</groupId>
          <artifactId>keycloak-wildfly-adapter-dist</artifactId>
          <type>zip</type>
        </dependency>
      </dependencies>
      <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-wildfly8</id>
                <phase>install</phase>
                <configuration>
                  <tasks>
                    <property name="appserver.id" value="jboss-wildfly-8" />
                    <property name="s-ramp.install.dir" value="${project.build.directory}" />
                    <property name="s-ramp.appserver.dir" location="${s-ramp.install.dir}/wildfly-8.2.0.Final" />

                    <!-- Overlord Commons Installer and Dependencies -->
                    <property name="s-ramp-overlord-commons.ant.jar.path" value="${maven.dependency.org.overlord.overlord-commons-ant.jar.path}"/>

                    <!-- Artificer WARs -->
                    <property name="s-ramp.s-ramp-server.war.path" value="${maven.dependency.org.artificer.artificer-server-wildfly8.war.path}" />
                    <property name="s-ramp.s-ramp-ui.war.path" value="${maven.dependency.org.artificer.artificer-ui-wildfly8.war.path}" />

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

                    <property file="build.properties" />
                    <property name="s-ramp.appserver.zip" value="${basedir}/wildfly-8.2.0.Final.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>

                    <!-- The commons ant jar location -->
                    <property name="overlord-commons.ant.jar" location="${s-ramp-overlord-commons.ant.jar.path}" />

                    <unzip src="${maven.dependency.org.keycloak.keycloak-war-dist-all.zip.path}" dest="${project.build.directory}"/>
                    <property name="s-ramp.keycloak.path" location="${project.build.directory}/keycloak-war-dist-all-${version.org.keycloak}" />
                    <property name="s-ramp.keycloak.adapter" location="${maven.dependency.org.keycloak.keycloak-wildfly-adapter-dist.zip.path}" />

                    <!-- Call the installer -->
                    <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>
    <!-- ***************************************** -->
    <!-- Profile to *test* installing into EAP 6.3 -->
    <!-- ***************************************** -->
    <profile>
      <id>test-install-eap63</id>
      <dependencyManagement>
        <dependencies>
          <dependency>
            <groupId>org.modeshape</groupId>
            <artifactId>modeshape-distribution</artifactId>
            <version>3.8.0.Final</version>
            <type>zip</type>
            <classifier>jbosseap-dist</classifier>
          </dependency>
        </dependencies>
      </dependencyManagement>
      <dependencies>
        <dependency>
          <groupId>org.modeshape</groupId>
          <artifactId>modeshape-distribution</artifactId>
          <type>zip</type>
          <classifier>jbosseap-dist</classifier>
        </dependency>
        <dependency>
          <groupId>org.keycloak</groupId>
          <artifactId>keycloak-war-dist-all</artifactId>
          <type>zip</type>
          <exclusions>
            <exclusion>
              <groupId>org.keycloak</groupId>
              <artifactId>keycloak-as7-adapter-dist</artifactId>
            </exclusion>
            <exclusion>
              <groupId>org.keycloak</groupId>
              <artifactId>keycloak-jetty81-adapter-dist</artifactId>
            </exclusion>
            <exclusion>
              <groupId>org.keycloak</groupId>
              <artifactId>keycloak-jetty91-adapter-dist</artifactId>
            </exclusion>
            <exclusion>
              <groupId>org.keycloak</groupId>
              <artifactId>keycloak-jetty92-adapter-dist</artifactId>
            </exclusion>
            <exclusion>
              <groupId>org.keycloak</groupId>
              <artifactId>keycloak-example-themes-dist</artifactId>
            </exclusion>
          </exclusions>
        </dependency>
        <dependency>
          <groupId>org.keycloak</groupId>
          <artifactId>keycloak-eap6-adapter-dist</artifactId>
          <type>zip</type>
        </dependency>
      </dependencies>
      <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-eap63</id>
                <phase>install</phase>
                <configuration>
                  <tasks>
                    <property name="appserver.id" value="jboss-eap-6" />
                    <property name="s-ramp.install.dir" value="${project.build.directory}" />
                    <property name="s-ramp.appserver.dir" location="${s-ramp.install.dir}/jboss-eap-6.3" />

                    <!-- Overlord Commons Installer and Dependencies -->
                    <property name="s-ramp-overlord-commons.ant.jar.path" value="${maven.dependency.org.overlord.overlord-commons-ant.jar.path}"/>

                    <!-- Artificer WARs -->
                    <property name="s-ramp.s-ramp-server.war.path" value="${maven.dependency.org.artificer.artificer-server-eap6.war.path}" />
                    <property name="s-ramp.s-ramp-ui.war.path" value="${maven.dependency.org.artificer.artificer-ui-eap6.war.path}" />

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

                    <property file="build.properties" />
                    <property name="s-ramp.appserver.zip" value="${basedir}/jboss-eap-6.3.0.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>

                    <!-- The commons ant jar location -->
                    <property name="overlord-commons.ant.jar" location="${s-ramp-overlord-commons.ant.jar.path}" />

                    <unzip src="${maven.dependency.org.keycloak.keycloak-war-dist-all.zip.path}" dest="${project.build.directory}"/>
                    <property name="s-ramp.keycloak.path" location="${project.build.directory}/keycloak-war-dist-all-${version.org.keycloak}" />
                    <property name="s-ramp.keycloak.adapter" location="${maven.dependency.org.keycloak.keycloak-eap6-adapter-dist.zip.path}" />

                    <!-- Call the installer -->
                    <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>
    <!-- ***************************************** -->
    <!-- Profile to *test* installing into EAP 6.4 -->
    <!-- ***************************************** -->
    <profile>
      <id>test-install-eap64</id>
      <dependencyManagement>
        <dependencies>
          <dependency>
            <groupId>org.modeshape</groupId>
            <artifactId>modeshape-distribution</artifactId>
            <version>3.8.0.Final</version>
            <type>zip</type>
            <classifier>jbosseap-dist</classifier>
          </dependency>
        </dependencies>
      </dependencyManagement>
      <dependencies>
        <dependency>
          <groupId>org.modeshape</groupId>
          <artifactId>modeshape-distribution</artifactId>
          <type>zip</type>
          <classifier>jbosseap-dist</classifier>
        </dependency>
        <dependency>
          <groupId>org.keycloak</groupId>
          <artifactId>keycloak-war-dist-all</artifactId>
          <type>zip</type>
          <exclusions>
            <exclusion>
              <groupId>org.keycloak</groupId>
              <artifactId>keycloak-as7-adapter-dist</artifactId>
            </exclusion>
            <exclusion>
              <groupId>org.keycloak</groupId>
              <artifactId>keycloak-jetty81-adapter-dist</artifactId>
            </exclusion>
            <exclusion>
              <groupId>org.keycloak</groupId>
              <artifactId>keycloak-jetty91-adapter-dist</artifactId>
            </exclusion>
            <exclusion>
              <groupId>org.keycloak</groupId>
              <artifactId>keycloak-jetty92-adapter-dist</artifactId>
            </exclusion>
            <exclusion>
              <groupId>org.keycloak</groupId>
              <artifactId>keycloak-example-themes-dist</artifactId>
            </exclusion>
          </exclusions>
        </dependency>
        <dependency>
          <groupId>org.keycloak</groupId>
          <artifactId>keycloak-eap6-adapter-dist</artifactId>
          <type>zip</type>
        </dependency>
      </dependencies>
      <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-eap64</id>
                <phase>install</phase>
                <configuration>
                  <tasks>
                    <property name="appserver.id" value="jboss-eap-6" />
                    <property name="s-ramp.install.dir" value="${project.build.directory}" />
                    <property name="s-ramp.appserver.dir" location="${s-ramp.install.dir}/jboss-eap-6.4" />

                    <!-- Overlord Commons Installer and Dependencies -->
                    <property name="s-ramp-overlord-commons.ant.jar.path" value="${maven.dependency.org.overlord.overlord-commons-ant.jar.path}"/>

                    <!-- Artificer WARs -->
                    <property name="s-ramp.s-ramp-server.war.path" value="${maven.dependency.org.artificer.artificer-server-eap6.war.path}" />
                    <property name="s-ramp.s-ramp-ui.war.path" value="${maven.dependency.org.artificer.artificer-ui-eap6.war.path}" />

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

                    <property file="build.properties" />
                    <property name="s-ramp.appserver.zip" value="${basedir}/jboss-eap-6.4.0.Beta.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>

                    <!-- The commons ant jar location -->
                    <property name="overlord-commons.ant.jar" location="${s-ramp-overlord-commons.ant.jar.path}" />

                    <unzip src="${maven.dependency.org.keycloak.keycloak-war-dist-all.zip.path}" dest="${project.build.directory}"/>
                    <property name="s-ramp.keycloak.path" location="${project.build.directory}/keycloak-war-dist-all-${version.org.keycloak}" />
                    <property name="s-ramp.keycloak.adapter" location="${maven.dependency.org.keycloak.keycloak-eap6-adapter-dist.zip.path}" />

                    <!-- Call the installer -->
                    <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>
