<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://maven.apache.org/POM/4.0.0"
         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>

    <parent>
        <groupId>net.unit8.enkan</groupId>
        <artifactId>enkan-parent</artifactId>
        <version>0.12.0</version>
    </parent>
    <artifactId>kotowari-example</artifactId>
    <packaging>jar</packaging>

    <name>kotowari-example</name>
    <description>An example of Kotowari application</description>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>21</source>
                    <target>21</target>
                    <annotationProcessorPaths>
                        <path>
                            <groupId>org.seasar.doma</groupId>
                            <artifactId>doma-processor</artifactId>
                            <version>2.62.1</version>
                        </path>
                    </annotationProcessorPaths>
                    <compilerArgs>
                        <arg>-Adoma.resources.dir=${project.basedir}/src/main/resources</arg>
                        <arg>-Adoma.dao.subpackage=impl</arg>
                        <arg>-Adoma.dao.suffix=Impl</arg>
                    </compilerArgs>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <configuration>
                    <skip>true</skip>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <configuration>
                    <mainClass>kotowari.example.Main</mainClass>
                    <includePluginDependencies>false</includePluginDependencies>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>net.unit8.enkan</groupId>
            <artifactId>enkan-system</artifactId>
            <version>${enkan.version}</version>
        </dependency>
        <dependency>
            <groupId>net.unit8.enkan</groupId>
            <artifactId>enkan-repl-server</artifactId>
            <version>${enkan.version}</version>
        </dependency>
        <dependency>
            <groupId>net.unit8.enkan</groupId>
            <artifactId>kotowari</artifactId>
            <version>${enkan.version}</version>
        </dependency>
        <dependency>
            <groupId>net.unit8.enkan</groupId>
            <artifactId>enkan-component-undertow</artifactId>
            <version>${enkan.version}</version>
        </dependency>
        <dependency>
            <groupId>net.unit8.enkan</groupId>
            <artifactId>enkan-component-jetty</artifactId>
            <version>${enkan.version}</version>
        </dependency>
        <dependency>
            <groupId>net.unit8.enkan</groupId>
            <artifactId>enkan-component-doma2</artifactId>
            <version>${enkan.version}</version>
        </dependency>
        <dependency>
            <groupId>net.unit8.enkan</groupId>
            <artifactId>enkan-component-jackson</artifactId>
            <version>${enkan.version}</version>
        </dependency>
        <dependency>
            <groupId>net.unit8.enkan</groupId>
            <artifactId>enkan-component-HikariCP</artifactId>
            <version>${enkan.version}</version>
        </dependency>
        <dependency>
            <groupId>net.unit8.enkan</groupId>
            <artifactId>enkan-component-flyway</artifactId>
            <version>${enkan.version}</version>
        </dependency>
        <dependency>
            <groupId>net.unit8.enkan</groupId>
            <artifactId>enkan-component-freemarker</artifactId>
            <version>${enkan.version}</version>
        </dependency>
        <dependency>
            <groupId>net.unit8.enkan</groupId>
            <artifactId>enkan-component-metrics</artifactId>
            <version>${enkan.version}</version>
        </dependency>
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <version>2.4.240</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
        </dependency>
        <dependency>
            <groupId>org.glassfish.expressly</groupId>
            <artifactId>expressly</artifactId>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>jakarta.ws.rs</groupId>
            <artifactId>jakarta.ws.rs-api</artifactId>
        </dependency>
    </dependencies>


    <profiles>
        <profile>
            <id>dev</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>exec-maven-plugin</artifactId>
                        <configuration>
                            <mainClass>kotowari.example.DevMain</mainClass>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>build-helper-maven-plugin</artifactId>
                        <version>3.6.1</version>
                        <executions>
                            <execution>
                                <id>add-dev-source</id>
                                <phase>generate-sources</phase>
                                <goals><goal>add-source</goal></goals>
                                <configuration>
                                    <sources>
                                        <source>src/dev/java</source>
                                    </sources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
            <dependencies>
                <dependency>
                    <groupId>net.unit8.enkan</groupId>
                    <artifactId>enkan-devel</artifactId>
                    <version>${enkan.version}</version>
                </dependency>
            </dependencies>
        </profile>

        <profile>
            <id>prod</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>exec-maven-plugin</artifactId>
                        <configuration>
                            <mainClass>kotowari.example.Main</mainClass>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
