<?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>webapp-runner-parent</artifactId>
        <groupId>com.heroku</groupId>
        <version>10.1.55.0</version>
    </parent>
    <name>webapp-runner</name>
    <modelVersion>4.0.0</modelVersion>
    <artifactId>webapp-runner</artifactId>
    <build>
        <finalName>webapp-runner</finalName>
        <plugins>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>${assembly.plugin.version}</version>
                <configuration>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                    <finalName>webapp-runner</finalName>
                    <appendAssemblyId>false</appendAssemblyId>
                    <archive>
                        <manifest>
                            <mainClass>webapp.runner.launch.Main</mainClass>
                        </manifest>
                    </archive>
                </configuration>
                <executions>
                    <execution>
                        <id>build-jar-with-dependencies</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-source-plugin</artifactId>
                <version>${source.plugin.version}</version>
                <executions>
                    <execution>
                        <id>attach-source</id>
                        <phase>deploy</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>deploy</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                            <doclint>none</doclint>
                            <sourcepath>
                                ${project.parent.basedir}/webapp-runner-main/src/main/java:${project.parent.basedir}/webapp-runner-memcached/src/main/java:${project.parent.basedir}/webapp-runner-redis/src/main/java
                            </sourcepath>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <profiles>
        <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 webapp-runner as a dependency to another project.
                    -->
                    <missing>bogus-file-87fwqy8efadhda</missing>
                </file>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>com.heroku</groupId>
                    <artifactId>webapp-runner-main</artifactId>
                    <version>${project.version}</version>
                    <scope>compile</scope>
                </dependency>
                <dependency>
                    <groupId>com.heroku</groupId>
                    <artifactId>webapp-runner-memcached</artifactId>
                    <version>${project.version}</version>
                    <scope>compile</scope>
                </dependency>
                <dependency>
                    <groupId>com.heroku</groupId>
                    <artifactId>webapp-runner-redis</artifactId>
                    <version>${project.version}</version>
                    <scope>compile</scope>
                </dependency>
            </dependencies>
        </profile>
    </profiles>
</project>
