<?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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>cz.cvut.kbss.jopa</groupId>
    <version>1.2.2</version>
    <artifactId>jopa-all</artifactId>
    <packaging>pom</packaging>
    <name>JOPA</name>
    <description>
        Java OWL Persistence API - a library for accessing semantic data programmatically.
    </description>
    <url>https://github.com/kbss-cvut/jopa</url>

    <modules>
        <module>jopa-api</module>
        <module>ontodriver-api</module>
        <module>jopa-owlapi-utils</module>
        <module>jopa-owl2java</module>
        <module>modelgen</module>
        <module>jopa-maven-plugin</module>
        <module>datatype</module>
        <module>ontodriver-jena</module>
        <module>ontodriver-owlapi</module>
        <module>ontodriver-rdf4j</module>
        <module>jopa-impl</module>
        <module>jopa-integration-tests</module>
        <module>jopa-integration-tests-jena</module>
        <module>jopa-integration-tests-owlapi</module>
        <module>jopa-integration-tests-rdf4j</module>
        <module>jopa-distribution</module>
    </modules>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <jdk.version>11</jdk.version>
        <maven.compiler.source>${jdk.version}</maven.compiler.source>
        <maven.compiler.target>${jdk.version}</maven.compiler.target>

        <org.slf4j.version>2.0.6</org.slf4j.version>
        <org.junit.jupiter.version>5.9.2</org.junit.jupiter.version>
        <org.mockito.version>5.3.1</org.mockito.version>
        <org.aspectj.version>1.9.20</org.aspectj.version>
        <ch.qos.logback.version>1.4.12</ch.qos.logback.version>

        <!-- We use OWLAPI in multiple modules, so let's keep them in sync -->
        <net.sourceforge.owlapi.version>5.5.0</net.sourceforge.owlapi.version>

        <maven.aspectj.plugin.version>1.13.1</maven.aspectj.plugin.version>
        <maven.deploy.plugin.version>3.1.1</maven.deploy.plugin.version>
        <maven.javadoc.plugin.version>3.6.0</maven.javadoc.plugin.version>
        <maven.surefire.plugin.version>2.22.2</maven.surefire.plugin.version>
    </properties>

    <dependencies>
        <!-- Logging facade -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${org.slf4j.version}</version>
        </dependency>

        <!-- Testing dependencies -->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>${org.junit.jupiter.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-params</artifactId>
            <version>${org.junit.jupiter.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>${org.junit.jupiter.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>${org.mockito.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-junit-jupiter</artifactId>
            <version>${org.mockito.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest</artifactId>
            <version>2.2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>${ch.qos.logback.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>3.2.1</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>${maven.javadoc.plugin.version}</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration> <!-- add this to disable checking -->
                            <additionalparam>-Xdoclint:none</additionalparam>
                            <aggregate>true</aggregate>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <!-- explicitly define maven-deploy-plugin after other to force exec order -->
                        <artifactId>maven-deploy-plugin</artifactId>
                        <version>${maven.deploy.plugin.version}</version>
                        <executions>
                            <execution>
                                <id>deploy</id>
                                <phase>deploy</phase>
                                <goals>
                                    <goal>deploy</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <build>
        <finalName>jopa-${project.version}</finalName>
        <directory>target</directory>

        <extensions>
            <!-- Enabling the use of FTP -->
            <extension>
                <groupId>org.apache.maven.wagon</groupId>
                <artifactId>wagon-ssh</artifactId>
                <version>3.0.0</version>
            </extension>
        </extensions>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.0</version>
            </plugin>

            <!-- Code coverage plugin -->
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.8.8</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>report</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- use mvn license:check to check for missing license headers, mvn license:format to add license headers -->
            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>3.0</version>
                <configuration>
                    <mapping>
                        <java>SLASHSTAR_STYLE</java>
                    </mapping>
                    <header>header.txt</header>
                    <excludes>
                        <exclude>**/src/test/resources/**</exclude>
                        <exclude>**/src/main/resources/**</exclude>
                        <exclude>**/testResults/**</exclude>
                        <exclude>**/*.owl</exclude>
                        <exclude>license</exclude>
                        <exclude>readme</exclude>
                        <exclude>**/*.txt</exclude>
                        <exclude>**/*.md</exclude>
                        <exclude>**/maven.yml</exclude>
                        <exclude>**/pom.xml</exclude>
                        <exclude>.editorconfig</exclude>
                        <exclude>.gitattributes</exclude>
                    </excludes>
                </configuration>
            </plugin>

            <!-- Set project version (recursively) -->
            <!-- Usage mvn versions:set -DnewVersion=$version and then mvn versions:commit to confirm changes -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>versions-maven-plugin</artifactId>
                <version>2.7</version>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven.surefire.plugin.version}</version>
            </plugin>
        </plugins>

        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>dev.aspectj</groupId>
                    <artifactId>aspectj-maven-plugin</artifactId>
                    <version>${maven.aspectj.plugin.version}</version>
                    <configuration>
                        <complianceLevel>${jdk.version}</complianceLevel>
                        <source>${jdk.version}</source>
                        <target>${jdk.version}</target>
                        <aspectLibraries>
                            <aspectLibrary>
                                <groupId>cz.cvut.kbss.jopa</groupId>
                                <artifactId>jopa-impl</artifactId>
                            </aspectLibrary>
                        </aspectLibraries>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>org.aspectj</groupId>
                            <artifactId>aspectjtools</artifactId>
                            <version>${org.aspectj.version}</version>
                        </dependency>
                        <dependency>
                            <groupId>org.aspectj</groupId>
                            <artifactId>aspectjrt</artifactId>
                            <version>${org.aspectj.version}</version>
                        </dependency>
                    </dependencies>
                    <executions>
                        <execution>
                            <id>compile</id>
                            <phase>process-classes</phase>
                            <goals>
                                <goal>compile</goal>
                                <!-- use this goal to weave all your main classes -->
                            </goals>
                        </execution>
                        <execution>
                            <!-- Split into two executions to ensure AJC runs AFTER regular compile in tests as well -->
                            <id>test-compile</id>
                            <phase>process-test-classes</phase>
                            <goals>
                                <!-- use this goal to weave all test classes -->
                                <goal>test-compile</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <licenses>
        <license>
            <name>GNU Lesser General Public License</name>
            <url>http://www.gnu.org/copyleft/lesser.html</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Petr Křemen</name>
            <email>petr.kremen@fel.cvut.cz</email>
            <url>https://cs.fel.cvut.cz/en/people/kremep1</url>
            <organization>Czech Technical University in Prague, Knowledge Based and Software Systems Group
            </organization>
            <organizationUrl>https://kbss.felk.cvut.cz</organizationUrl>
            <roles>
            </roles>
        </developer>
        <developer>
            <name>Martin Ledvinka</name>
            <email>martin.ledvinka@fel.cvut.cz</email>
            <organization>Czech Technical University in Prague, Knowledge Based and Software Systems Group
            </organization>
            <organizationUrl>https://kbss.felk.cvut.cz</organizationUrl>
            <roles>
            </roles>
        </developer>
    </developers>

    <organization>
        <name>Czech Technical University in Prague, Knowledge Based and Software Systems Group</name>
        <url>https://kbss.felk.cvut.cz</url>
    </organization>

    <scm>
        <url>https://github.com/kbss-cvut/jopa.git</url>
        <connection>scm:git:https://github.com/kbss-cvut/jopa.git</connection>
    </scm>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
        <site>
            <id>jopa</id>
            <name>JOPA</name>
            <url>https://github.com/kbss-cvut/jopa</url>
        </site>
        <downloadUrl>https://github.com/kbss-cvut/jopa/releases</downloadUrl>
    </distributionManagement>
</project>
