<?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">

    <groupId>com.inovexcorp</groupId>
    <artifactId>OntoCheck</artifactId>
    <version>2.4.0</version>
    <modelVersion>4.0.0</modelVersion>

    <!-- Same packaging and name changes as the other bundles -->
    <packaging>bundle</packaging>
    <name>${project.groupId}.${project.artifactId}</name>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.build.timestamp.format>yyyyMMddHHmm</maven.build.timestamp.format>
        <maven-bundle-plugin.version>5.1.4</maven-bundle-plugin.version>
        <maven-jar-plugin.version>3.2.2</maven-jar-plugin.version>
        <osgi-service-jaxrs.version>1.0.0</osgi-service-jaxrs.version>
        <osgi-service-cm.version>1.6.1</osgi-service-cm.version>
        <osgi-service-event.version>1.4.0</osgi-service-event.version>
        <osgi-service-component>1.5.0</osgi-service-component>
        <osgi-component-annotations.version>1.5.0</osgi-component-annotations.version>
        <osgi-metatype-annotations.version>1.4.1</osgi-metatype-annotations.version>
        <osgi-versioning.version>1.1.2</osgi-versioning.version>
        <osgi.version>8.0.0</osgi.version>
        <rdf4j.version>4.3.2</rdf4j.version>
        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>17</maven.compiler.target>
        <mobi.version>4.3.1</mobi.version>
        <karaf.version>4.4.3</karaf.version>
        <servlet.version>3.1.0</servlet.version>
        <logback.version>1.2.11</logback.version>
    </properties>

    <dependencies>
        <!-- Mobi Dependencies -->
        <dependency>
            <groupId>com.mobi</groupId>
            <artifactId>security.policy.api.xacml</artifactId>
            <version>${mobi.version}</version>
        </dependency>
        <dependency>
            <groupId>com.mobi</groupId>
            <artifactId>web.security</artifactId>
            <version>${mobi.version}</version>
        </dependency>
        <dependency>
            <groupId>com.mobi</groupId>
            <artifactId>platform.config.api</artifactId>
            <version>${mobi.version}</version>
        </dependency>
        <dependency>
            <groupId>com.mobi</groupId>
            <artifactId>rest.util</artifactId>
            <version>${mobi.version}</version>
        </dependency>
        <dependency>
            <groupId>com.mobi</groupId>
            <artifactId>rest.security</artifactId>
            <version>${mobi.version}</version>
        </dependency>
        <!-- Mobi services backing the ported star-rating engine -->
        <dependency>
            <groupId>com.mobi</groupId>
            <artifactId>catalog.api</artifactId>
            <version>${mobi.version}</version>
        </dependency>
        <dependency>
            <groupId>com.mobi</groupId>
            <artifactId>ontology.api</artifactId>
            <version>${mobi.version}</version>
        </dependency>
        <dependency>
            <groupId>com.mobi</groupId>
            <artifactId>dataset.api</artifactId>
            <version>${mobi.version}</version>
        </dependency>
        <dependency>
            <groupId>com.mobi</groupId>
            <artifactId>shapes.api</artifactId>
            <version>${mobi.version}</version>
        </dependency>
        <dependency>
            <groupId>com.mobi</groupId>
            <artifactId>persistence.api</artifactId>
            <version>${mobi.version}</version>
        </dependency>
        <dependency>
            <groupId>com.mobi</groupId>
            <artifactId>rdf.orm</artifactId>
            <version>${mobi.version}</version>
        </dependency>
        <dependency>
            <groupId>com.mobi</groupId>
            <artifactId>jaas.api</artifactId>
            <version>${mobi.version}</version>
        </dependency>
        <!--
            Mobi's shared server-sent event stream, at /mobirest/sse-stream. Depended on for SSETopics; the stream
            itself is driven by posting to its EventAdmin topic, so OntoCheck registers no SSE endpoint of its own.
        -->
        <dependency>
            <groupId>com.mobi</groupId>
            <artifactId>sse</artifactId>
            <version>${mobi.version}</version>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.service.event</artifactId>
            <version>${osgi-service-event.version}</version>
        </dependency>

        <!-- RDF4J pieces used to score ontologies in-process -->
        <dependency>
            <groupId>org.eclipse.rdf4j</groupId>
            <artifactId>rdf4j-model</artifactId>
            <version>${rdf4j.version}</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.rdf4j</groupId>
            <artifactId>rdf4j-model-vocabulary</artifactId>
            <version>${rdf4j.version}</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.rdf4j</groupId>
            <artifactId>rdf4j-query</artifactId>
            <version>${rdf4j.version}</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.rdf4j</groupId>
            <artifactId>rdf4j-repository-api</artifactId>
            <version>${rdf4j.version}</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.rdf4j</groupId>
            <artifactId>rdf4j-repository-sail</artifactId>
            <version>${rdf4j.version}</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.rdf4j</groupId>
            <artifactId>rdf4j-sail-memory</artifactId>
            <version>${rdf4j.version}</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.rdf4j</groupId>
            <artifactId>rdf4j-rio-api</artifactId>
            <version>${rdf4j.version}</version>
        </dependency>

        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.service.metatype.annotations</artifactId>
            <version>${osgi-metatype-annotations.version}</version>
        </dependency>

        <!-- Add dependencies required for the Whiteboard Extender pattern -->
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.service.http.whiteboard</artifactId>
            <version>1.1.0</version>
        </dependency>
        <!-- Core OSGi dependencies -->
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>osgi.core</artifactId>
            <version>8.0.0</version>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.service.component</artifactId>
            <version>1.5.0</version>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.service.cm</artifactId>
            <version>1.6.1</version>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.service.component.annotations</artifactId>
            <version>1.5.0</version>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.service.jaxrs</artifactId>
            <version>1.0.1</version>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>${servlet.version}</version>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>${logback.version}</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <!-- Needed similarly to the other bundles -->
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
                        <Bundle-Version>${project.version}</Bundle-Version>
                        <Bundle-Name>OntoCheck</Bundle-Name>
                        <!-- This bundle won't export anything -->
                        <Export-Package />
                        <Import-Package>
                            *
                        </Import-Package>
                        <Service-Component>*</Service-Component>
                        <build>${maven.build.timestamp}</build>
                        <_snapshot>${maven.build.timestamp}</_snapshot>
                    </instructions>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>3.0.0</version>
                <executions>
                    <execution>
                        <id>clean</id>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <phase>clean</phase>
                        <configuration>
                            <executable>npm</executable>
                            <arguments>
                                <argument>run</argument>
                                <argument>clean</argument>
                            </arguments>
                        </configuration>
                    </execution>
                    <execution>
                        <id>npm install</id>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <phase>generate-sources</phase>
                        <configuration>
                            <executable>npm</executable>
                            <arguments>
                                <argument>install</argument>
                            </arguments>
                        </configuration>
                    </execution>
                    <execution>
                        <id>build</id>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <phase>generate-sources</phase>
                        <configuration>
                            <executable>npm</executable>
                            <arguments>
                                <argument>run</argument>
                                <argument>build</argument>
                            </arguments>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <excludes>
                    <exclude>webapp/**</exclude>
                </excludes>
            </resource>
            <resource>
                <directory>target/classes</directory>
                <includes>
                    <include>build/**</include>
                </includes>
            </resource>
        </resources>
    </build>

    <repositories>
        <repository>
            <id>inovex-public</id>
            <url>https://nexus.inovexcorp.com/nexus/content/repositories/foundry-maven-prod-group</url>
        </repository>
        <repository>
            <id>inovex</id>
            <url>https://nexus.inovexcorp.com/nexus/content/repositories/foundry-maven-dev-group</url>
        </repository>
    </repositories>
</project>
