<?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">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.nerdypant.pickthestick</groupId>
    <artifactId>container</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <packaging>pom</packaging>
    <properties>
        <maven.compiler.source>21</maven.compiler.source>
        <maven.compiler.target>21</maven.compiler.target>
        <detached>true</detached>
        <no-cache>false</no-cache>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-server</artifactId>
            <version>12.1.6</version>
        </dependency>


    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>com.dkanejs.maven.plugins</groupId>
                <artifactId>docker-compose-maven-plugin</artifactId>
                <version>4.0.0</version>
                <inherited>false</inherited>
                <executions>
                    <execution>
                        <id>down</id>
                        <phase>verify</phase>
                        <configuration>
                            <verbose>true</verbose>
                            <composeFile>${project.basedir}/docker-compose.yml</composeFile>
                        </configuration>
                        <goals>
                            <goal>down</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>build</id>
                        <phase>install</phase>
                        <configuration>
                            <buildArgs>
                                <no-cache>${no-cache}</no-cache>
                            </buildArgs>
                            <verbose>true</verbose>
                            <composeFile>${project.basedir}/docker-compose.yml</composeFile>
                        </configuration>
                        <goals>
                            <goal>build</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>up</id>
                        <phase>install</phase>
                        <configuration>
                            <detachedMode>${detached}</detachedMode>
                            <verbose>true</verbose>
                            <composeFile>${project.basedir}/docker-compose.yml</composeFile>
                        </configuration>
                        <goals>
                            <goal>up</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <artifactId>maven-clean-plugin</artifactId>
                <version>3.3.2</version>
                <inherited>true</inherited>
                <configuration>
                    <filesets>
                        <fileset>
                            <directory>target</directory>
                            <includes>
                                <include>**/*.war</include>
                            </includes>
                            <followSymlinks>false</followSymlinks>
                        </fileset>
                        <!--<fileset>
                            <directory>target</directory>
                            <includes>
                                <include>**/*.war</include>
                            </includes>
                            <followSymlinks>false</followSymlinks>
                        </fileset>-->
                    </filesets>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>