<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">
  <parent>
    <groupId>com.atlassian.bamboo</groupId>
    <artifactId>atlassian-bamboo-components</artifactId>
    <version>5.6-m4</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>

  <groupId>com.atlassian.bamboo</groupId>
  <artifactId>atlassian-bamboo-installer</artifactId>
  <version>5.6-m4</version>

  <packaging>jar</packaging>

  <name>Atlassian Bamboo Installer</name>

  <profiles>
    <profile>
      <id>localRelease</id>
      <dependencies>
        <dependency>
          <groupId>install4j</groupId>
          <artifactId>i4jruntime</artifactId>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-antrun-plugin</artifactId>
            <executions>
              <execution>
                <phase>package</phase>
                <configuration>
                  <tasks>
                    <taskdef name="install4j" classname="com.install4j.Install4JTask" classpath="/Applications/install4j 4/bin/ant.jar" />
                    <install4j projectfile="../src/conf/installer/bamboo.install4j" verbose="true" destination="../build-dir" release="${project.install4JVersion}" />
                  </tasks>
                </configuration>
                <goals>
                  <goal>run</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>release-profile</id>
      <dependencies>
        <dependency>
          <groupId>install4j</groupId>
          <artifactId>i4jruntime</artifactId>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-antrun-plugin</artifactId>
            <executions>
              <execution>
                <phase>package</phase>
                <configuration>
                  <tasks>
                    <taskdef name="install4j" classname="com.install4j.Install4JTask" classpath="/opt/install4j_4/bin/ant.jar" />
                    <install4j projectfile="../src/conf/installer/bamboo.install4j" verbose="true" destination="../build-dir" release="${project.install4JVersion}" />
                    <!--<scp file="../build-dir/*" todir="bamboo@downloads.atlassian.com:upload" />-->
                    <!--<scp file="../bamboo-web-app/target/*.war" todir="bamboo@downloads.atlassian.com:upload" />-->
                  </tasks>
                </configuration>
                <goals>
                  <goal>run</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>release</id>
      <dependencies>
        <dependency>
          <groupId>install4j</groupId>
          <artifactId>i4jruntime</artifactId>
        </dependency>
      </dependencies>
    </profile>

  </profiles>

</project>
