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

    <parent>
        <groupId>it.unibz.inf.ontop</groupId>
        <artifactId>ontop-client</artifactId>
        <version>4.0.9-sansa</version>
    </parent>

    <artifactId>ontop-protege</artifactId>
    <description>Ontop OBDA plugin for protégé</description>
    <url>http://ontop.inf.unibz.it/</url>

    <organization>
        <name>KRDB Research Centre for Knowledge and Data, Free University of Bozen-Bolzano</name>
        <url>http://www.inf.unibz.it/krdb/</url>
    </organization>

    <properties>
        <symbolic.name>it.unibz.inf.ontop.protege</symbolic.name>
        <finalName>${symbolic.name}-${project.version}</finalName>
        <filter.main.resources>true</filter.main.resources>
        <skipTests>true</skipTests>
    </properties>

    <dependencies>
        <!-- dependencies available from Protege: begin -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-core</artifactId>
            <scope>provided</scope>
        </dependency>
        <!-- dependencies available from Protege: end -->

        <dependency>
            <groupId>com.opencsv</groupId>
            <artifactId>opencsv</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-collections4</artifactId>
        </dependency>
        <dependency>
            <groupId>org.eclipse.rdf4j</groupId>
            <artifactId>rdf4j-queryalgebra-evaluation</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient-osgi</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpcore-osgi</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpcore-nio</artifactId>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.mikael</groupId>
            <artifactId>urlbuilder</artifactId>
        </dependency>

        <!-- OBDA libraries -->
        <!-- These are dependencies to the OBDA related classes. -->
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>ontop-model</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>ontop-optimization</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>ontop-obda-core</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>ontop-rdb</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>ontop-mapping-core</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>ontop-mapping-sql-core</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>ontop-mapping-native</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>ontop-mapping-r2rml</artifactId>
            <exclusions>
                <exclusion>
                    <artifactId>owlapi-impl</artifactId>
                    <groupId>net.sourceforge.owlapi</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>owlapi-api</artifactId>
                    <groupId>net.sourceforge.owlapi</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>ontop-mapping-sql-all</artifactId>
            <exclusions>
                <exclusion>
                    <artifactId>owlapi-impl</artifactId>
                    <groupId>net.sourceforge.owlapi</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>ontop-ontology-owlapi</artifactId>
            <exclusions>
                <exclusion>
                    <artifactId>owlapi-api</artifactId>
                    <groupId>net.sourceforge.owlapi</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>owlapi-apibinding</artifactId>
                    <groupId>net.sourceforge.owlapi</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>ontop-mapping-owlapi</artifactId>
            <exclusions>
                <exclusion>
                    <artifactId>owlapi-api</artifactId>
                    <groupId>net.sourceforge.owlapi</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>owlapi-apibinding</artifactId>
                    <groupId>net.sourceforge.owlapi</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>ontop-mapping-sql-owlapi</artifactId>
            <exclusions>
                <exclusion>
                    <artifactId>owlapi-api</artifactId>
                    <groupId>net.sourceforge.owlapi</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>owlapi-apibinding</artifactId>
                    <groupId>net.sourceforge.owlapi</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>ontop-reformulation-core</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>ontop-reformulation-sql</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>ontop-system-core</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>ontop-system-sql-core</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>ontop-system-owlapi</artifactId>
            <exclusions>
                <exclusion>
                    <artifactId>owlapi-api</artifactId>
                    <groupId>net.sourceforge.owlapi</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>owlapi-apibinding</artifactId>
                    <groupId>net.sourceforge.owlapi</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>ontop-system-sql-owlapi</artifactId>
            <exclusions>
                <exclusion>
                    <artifactId>owlapi-api</artifactId>
                    <groupId>net.sourceforge.owlapi</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>owlapi-apibinding</artifactId>
                    <groupId>net.sourceforge.owlapi</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>ontop-owlapi</artifactId>
            <exclusions>
                <exclusion>
                    <artifactId>owlapi-api</artifactId>
                    <groupId>net.sourceforge.owlapi</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>owlapi-apibinding</artifactId>
                    <groupId>net.sourceforge.owlapi</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>ontop-rdf4j</artifactId>
            <version>${project.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>net.sourceforge.owlapi</groupId>
                    <artifactId>owlapi-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>net.sourceforge.owlapi</groupId>
                    <artifactId>owlapi-apibinding</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>ontop-shaded-guava</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.jgrapht</groupId>
            <artifactId>jgrapht-core</artifactId>
        </dependency>
        <dependency>
            <groupId>eu.optique-project</groupId>
            <artifactId>r2rml-api-core</artifactId>
        </dependency>
        <dependency>
            <groupId>eu.optique-project</groupId>
            <artifactId>r2rml-api-rdf4j-binding</artifactId>
        </dependency>
        <dependency>
            <groupId>xerces</groupId>
            <artifactId>xercesImpl</artifactId>
        </dependency>
        <dependency>
            <groupId>xml-apis</groupId>
            <artifactId>xml-apis</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.datatype</groupId>
            <artifactId>jackson-datatype-guava</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.thrift</groupId>
            <artifactId>libthrift</artifactId>
        </dependency>
        <!-- transtiive closure of commons-rdf-jena ends -->

        <!-- Protege and OWLAPI bundle dependencies -->
        <dependency>
            <groupId>edu.stanford.protege</groupId>
            <artifactId>protege-editor-core</artifactId>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <artifactId>semargl-rdfa</artifactId>
                    <groupId>org.semarglproject</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>edu.stanford.protege</groupId>
            <artifactId>protege-editor-owl</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- transitive dependencies -->
        <dependency>
            <groupId>org.antlr</groupId>
            <artifactId>antlr4-runtime</artifactId>
        </dependency>
        <dependency>
            <groupId>org.abego.treelayout</groupId>
            <artifactId>org.abego.treelayout.core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.glassfish</groupId>
            <artifactId>javax.json</artifactId>
        </dependency>
        <dependency>
            <groupId>com.ibm.icu</groupId>
            <artifactId>icu4j</artifactId>
        </dependency>
        <!-- antlr4 transitive dependencies end-->

        <dependency>
            <groupId>org.apache.tomcat</groupId>
            <artifactId>tomcat-jdbc</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.tomcat</groupId>
            <artifactId>tomcat-juli</artifactId>
        </dependency>
        <dependency>
            <groupId>com.zaxxer</groupId>
            <artifactId>HikariCP</artifactId>
        </dependency>
        <dependency>
            <groupId>org.eclipse.rdf4j</groupId>
            <artifactId>rdf4j-model</artifactId>
        </dependency>
        <dependency>
            <groupId>org.eclipse.rdf4j</groupId>
            <artifactId>rdf4j-query</artifactId>
        </dependency>
        <dependency>
            <groupId>org.eclipse.rdf4j</groupId>
            <artifactId>rdf4j-queryalgebra-model</artifactId>
        </dependency>
        <dependency>
            <groupId>org.eclipse.rdf4j</groupId>
            <artifactId>rdf4j-queryparser-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.eclipse.rdf4j</groupId>
            <artifactId>rdf4j-queryparser-sparql</artifactId>
        </dependency>
        <dependency>
            <groupId>org.eclipse.rdf4j</groupId>
            <artifactId>rdf4j-queryresultio-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.eclipse.rdf4j</groupId>
            <artifactId>rdf4j-queryresultio-text</artifactId>
        </dependency>
        <dependency>
            <groupId>org.eclipse.rdf4j</groupId>
            <artifactId>rdf4j-repository-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.eclipse.rdf4j</groupId>
            <artifactId>rdf4j-rio-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.eclipse.rdf4j</groupId>
            <artifactId>rdf4j-rio-datatypes</artifactId>
        </dependency>
        <dependency>
            <groupId>org.eclipse.rdf4j</groupId>
            <artifactId>rdf4j-rio-languages</artifactId>
        </dependency>
        <dependency>
            <groupId>org.eclipse.rdf4j</groupId>
            <artifactId>rdf4j-rio-ntriples</artifactId>
        </dependency>
        <dependency>
            <groupId>org.eclipse.rdf4j</groupId>
            <artifactId>rdf4j-rio-rdfxml</artifactId>
        </dependency>
        <dependency>
            <groupId>org.eclipse.rdf4j</groupId>
            <artifactId>rdf4j-rio-turtle</artifactId>
        </dependency>
        <dependency>
            <groupId>org.eclipse.rdf4j</groupId>
            <artifactId>rdf4j-sail-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.eclipse.rdf4j</groupId>
            <artifactId>rdf4j-util</artifactId>
        </dependency>
        <dependency>
            <groupId>org.eclipse.rdf4j</groupId>
            <artifactId>rdf4j-queryrender</artifactId>
        </dependency>
        <dependency>
            <groupId>org.eclipse.rdf4j</groupId>
            <artifactId>rdf4j-rio-trig</artifactId>
        </dependency>
        <dependency>
            <groupId>com.github.jsqlparser</groupId>
            <artifactId>jsqlparser</artifactId>
        </dependency>
        <dependency>
            <groupId>org.functionaljava</groupId>
            <artifactId>functionaljava</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.inject</groupId>
            <artifactId>guice</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.inject.extensions</groupId>
            <artifactId>guice-assistedinject</artifactId>
        </dependency>
        <dependency>
            <groupId>javax.inject</groupId>
            <artifactId>javax.inject</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>jsr305</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-rdf-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-rdf-rdf4j</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-rdf-simple</artifactId>
        </dependency>
        <dependency>
            <groupId>com.moandjiezana.toml</groupId>
            <artifactId>toml4j</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
        </dependency>
        <dependency>
            <groupId>org.eclipse.rdf4j</groupId>
            <artifactId>rdf4j-rio-nquads</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>failureaccess</artifactId>
        </dependency>
        <dependency>
            <groupId>org.locationtech.proj4j</groupId>
            <artifactId>proj4j</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <extensions>true</extensions>
                <executions>
                    <execution>
                        <id>attach-protege-bundle</id>
                        <phase>${bundle.protege.phase}</phase>
                        <goals>
                            <goal>bundle</goal>
                        </goals>
                        <configuration>
                            <classifier>bundle</classifier>

                            <!-- The following is the set of instructions of how pack the bundle and how to create the
                                 MANIFEST.MF for the bundle. The configuration does 3 things.

                                 1. It makes sure that the "tight" dependencies are not packed as jars, but as .class files
                                    (inline). It makes sure that all the runtime dependencies are packed as jars.

                                 2. It makes sure all the protege plugin resources are packed (plugin.xml, tabs*.xml, etc).

                                 3. It makes sure the META-INF/MANIFEST.MF for OSGi bundles is created with the correct imports,
                                    exports and classpath.
                            -->

                            <instructions>
                                <Bundle-RequiredExecutionEnvironment>JavaSE-1.8</Bundle-RequiredExecutionEnvironment>
                                <!-- This makes sure any dependency in the obdalib <dependency> dependencies are packed
                                     as .classes (uncompressed, no jars) and the rest is packed as .jars -->
                                <Embed-Dependency>*;groupId=it.unibz.inf.ontop.*;inline=true,*;groupId=it.unibz.inf.ontop.protege.*;inline=true,*;groupId=!it.unibz.inf.ontop;scope=compile|runtime</Embed-Dependency>

                                <!-- necessary for protege plugins -->
                                <Bundle-Category>protege</Bundle-Category>

                                <Bundle-ContactAddress>gh.xiao@gmail.com</Bundle-ContactAddress>
                                <Bundle-DocURL>${project.url}</Bundle-DocURL>
                                <Bundle-Name>Ontop OBDA Protégé plugin</Bundle-Name>
                                <Bundle-Description>${project.description}</Bundle-Description>
                                <Bundle-Vendor>${project.organization.name}</Bundle-Vendor>
                                <Implementation-Version>${project.version}</Implementation-Version>
                                <Update-Url>https://github.com/ontop/ontop/raw/master/ontop-protege/update.properties</Update-Url>

                                <Export-Package>
                                    <!-- No need to export any package -->
                                </Export-Package>

                                <Import-Package>!javax.xml.bind.annotation.adapters,!org.antlr.stringtemplate,!net.sf.ehcache,!net.spy.memcached,!org.apache.commons.logging,!org.eclipse.rdf4j.http.client,!org.eclipse.rdf4j.repository.sparql,!org.eclipse.rdf4j.repository.sparql.query,!org.eclipse.rdf4j.repository.sail,!org.eclipse.rdf4j.sail,!org.eclipse.rdf4j.sail.memory,!org.mapdb,!org.osgi.service.cm,!sun.misc,!javax.servlet,!javax.servlet.http,!org.apache.xml.*,!sun.io,!com.codahale.metrics.*,!io.prometheus.client,!javassist.*,!org.hibernate.*,!org.apache.commons.beanutils.*,!org.apache.commons.text,!org.eclipse.rdf4j.repository.sparql.federation,!com.github.andrewoma.dexx.collection,!org.checkerframework.checker.*,!com.github.luben.zstd,!org.brotli.dec,!org.tukaani.xz,!com.github.jsonldjava.*,!com.google.appengine.api,!com.google.apphosting.api,!com.google.common.util.concurrent.internal,!com.google.errorprone.annotations,!com.google.errorprone.annotations.concurrent,!com.google.inject.internal.asm.util,!io.micrometer.core.instrument,!org.antlr.v4.gui,!org.apache.jena.ext.com.google.appengine.api,!org.apache.jena.ext.com.google.appengine.api.utils,!org.apache.jena.ext.com.google.apphosting.api,!org.apache.jena.ext.com.google.errorprone.annotations,!org.apache.jena.ext.com.google.errorprone.annotations.concurrent,!org.apache.logging.log4j,!org.apache.logging.log4j.core,!org.apache.logging.log4j.core.config,!org.apache.logging.log4j.core.config.properties,!org.eclipse.rdf4j.rio.trigstar,*;-split-package:=merge-last</Import-Package>

                                <!-- The name of the plugin for OSGi dependencies. It has to be singleton
                                     or protege wont load it -->
                                <Bundle-SymbolicName>${symbolic.name};singleton:=true</Bundle-SymbolicName>

                                <Bundle-Activator>org.protege.osgi.jdbc.JdbcBundleActivator</Bundle-Activator>
                            </instructions>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>
