<?xml version="1.0" encoding="UTF-8"?>
<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">
  <parent>
    <artifactId>heroku-sdk-parent</artifactId>
    <groupId>com.heroku.sdk</groupId>
    <version>2.0.16</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>

  <name>Heroku Deployer</name>
  <description>
    Fat JAR version of heroku-deploy
  </description>

  <artifactId>heroku-deploy-complete</artifactId>

  <build>
    <finalName>heroku-deploy-complete</finalName>
    <plugins>
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <version>3.1.0</version>
        <configuration>
          <descriptorRefs>
            <descriptorRef>jar-with-dependencies</descriptorRef>
          </descriptorRefs>
          <appendAssemblyId>false</appendAssemblyId>
          <archive>
            <manifest>
              <mainClass>com.heroku.sdk.deploy.DeployWar</mainClass>
            </manifest>
          </archive>
        </configuration>
        <executions>
          <execution>
            <id>build-jar-with-dependencies</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>it</id>
      <properties>
        <maven.test.skip>false</maven.test.skip>
      </properties>
    </profile>

    <profile>
      <id>fatjar</id>
      <activation>
        <activeByDefault>false</activeByDefault>
        <file>
          <!--
            This will ensure the profile is always active, but Maven/Gradle won't resolve and install the
            module dependencies when adding heroku-deploy-complete as a dependency to another project.
          -->
          <missing>bogus-file-87fwqy8efadhda</missing>
        </file>
      </activation>
      <dependencies>
        <dependency>
          <groupId>com.heroku.sdk</groupId>
          <artifactId>heroku-deploy</artifactId>
          <version>${project.version}</version>
        </dependency>
        <dependency>
          <groupId>org.slf4j</groupId>
          <artifactId>slf4j-nop</artifactId>
          <version>1.7.25</version>
        </dependency>
      </dependencies>
    </profile>
    <profile>
      <id>release</id>
      <activation>
        <activeByDefault>false</activeByDefault>
        <property>
          <name>prepareForCentral</name>
          <value>true</value>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-source-plugin</artifactId>
            <version>${source.plugin.version}</version>
            <executions>
              <execution>
                <id>attach-source</id>
                <phase>package</phase>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
                <configuration>
                  <forceCreation>true</forceCreation>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>${javadoc.plugin.version}</version>
            <executions>
              <execution>
                <id>attach-javadoc</id>
                <phase>package</phase>
                <goals>
                  <goal>jar</goal>
                </goals>
                <configuration>
                  <additionalparam>-Xdoclint:none</additionalparam>
                  <sourcepath>
                    ${project.parent.basedir}/heroku-deploy/src/main/java
                  </sourcepath>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
