<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">
    <modelVersion>4.0.0</modelVersion>
    <artifactId>webgoat-server</artifactId>
    <packaging>jar</packaging>
    <parent>
        <groupId>org.owasp.webgoat</groupId>
        <artifactId>webgoat-parent</artifactId>
        <version>8.0-SNAPSHOT</version>
    </parent>

    <properties>
        <start-class>org.owasp.webgoat.StartWebGoat</start-class>
    </properties>

    <profiles>
        <profile>
            <id>raspberry-pi-3</id>
            <activation>
                <property>
                    <name>rpi</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.spotify</groupId>
                        <artifactId>docker-maven-plugin</artifactId>
                        <version>0.4.10</version>
                        <configuration>
                            <imageName>webgoat/webgoat-8.0</imageName>
                            <dockerDirectory>src/main/docker_rpi3</dockerDirectory>
                            <resources>
                                <resource>
                                    <targetPath>/</targetPath>
                                    <directory>${project.build.directory}</directory>
                                    <include>${project.build.finalName}.jar</include>
                                </resource>
                            </resources>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>default</id>
            <activation>
                <property>
                    <name>!rpi</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.spotify</groupId>
                        <artifactId>docker-maven-plugin</artifactId>
                        <version>0.4.10</version>
                        <configuration>
                            <imageName>webgoat/webgoat-8.0</imageName>
                            <dockerDirectory>src/main/docker</dockerDirectory>
                            <resources>
                                <resource>
                                    <targetPath>/</targetPath>
                                    <directory>${project.build.directory}</directory>
                                    <include>${project.build.finalName}.jar</include>
                                </resource>
                            </resources>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <dependencies>
        <dependency>
            <groupId>com.spotify</groupId>
            <artifactId>docker-maven-plugin</artifactId>
            <version>0.4.10</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.owasp.webgoat</groupId>
            <artifactId>webgoat-container</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.owasp.webgoat.lesson</groupId>
            <artifactId>challenge</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.owasp.webgoat.lesson</groupId>
            <artifactId>bypass-restrictions</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.owasp.webgoat.lesson</groupId>
            <artifactId>client-side-filtering</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.owasp.webgoat.lesson</groupId>
            <artifactId>cross-site-scripting</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.owasp.webgoat.lesson</groupId>
            <artifactId>html-tampering</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.owasp.webgoat.lesson</groupId>
            <artifactId>http-basics</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.owasp.webgoat.lesson</groupId>
            <artifactId>http-proxies</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.owasp.webgoat.lesson</groupId>
            <artifactId>idor</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.owasp.webgoat.lesson</groupId>
            <artifactId>insecure-login</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.owasp.webgoat.lesson</groupId>
            <artifactId>jwt</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.owasp.webgoat.lesson</groupId>
            <artifactId>sql-injection</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.owasp.webgoat.lesson</groupId>
            <artifactId>vulnerable-components</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.owasp.webgoat.lesson</groupId>
            <artifactId>xxe</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <optional>true</optional>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <!-- See http://docs.spring.io/spring-boot/docs/current/reference/html/howto-build.html#howto-extract-specific-libraries-when-an-executable-jar-runs -->
                    <requiresUnpack>
                        <dependency>
                            <groupId>org.thymeleaf.extra</groupId>
                            <artifactId>thymeleaf-extras-springsecurity4</artifactId>
                        </dependency>
                        <dependency>
                            <groupId>org.asciidoctor</groupId>
                            <artifactId>asciidoctorj</artifactId>
                        </dependency>
                        <dependency>
                            <groupId>org.jruby</groupId>
                            <artifactId>jruby-complete</artifactId>
                        </dependency>
                    </requiresUnpack>
                    <jvmArguments>
                        <!-- -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000-->
                    </jvmArguments>
                    <fork>true</fork>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>
