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

  <parent>
    <groupId>org.sonatype.oss</groupId>
    <artifactId>oss-parent</artifactId>
    <version>7</version>
  </parent>

  <groupId>edu.stanford.swrl</groupId>
  <artifactId>swrlapi-drools-engine</artifactId>
  <version>1.0.0-beta-21</version>
  <packaging>bundle</packaging>
  <name>Drools-based SWRL Rule Engine</name>
  <description>Drools implementation of SWRLAPI-based SWRL rule engine</description>
  <url>https://github.com/protegeproject/swrlapi-drools-engine/wiki/SWRLAPI-Drools-Engine</url>

  <properties>

    <swrlapi.version>1.0.0-beta-22</swrlapi.version>
    <owlapi.version>4.1.3</owlapi.version> 
    <drools.version>6.3.0.Final</drools.version> 

    <checker.framework.version>1.9.11</checker.framework.version>
    <annotatedJdk>${org.checkerframework:jdk8:jar}</annotatedJdk>
    <junit.version>4.12</junit.version>
    <slf4j.version>1.7.18</slf4j.version>

    <maven.compiler.plugin.version>3.5.1</maven.compiler.plugin.version>
    <maven.jar.plugin.version>2.6</maven.jar.plugin.version>
    <maven.dependency.plugin.version>2.10</maven.dependency.plugin.version>
    <maven.bundle.plugin.version>3.0.1</maven.bundle.plugin.version>
    <maven.release.plugin.version>2.5.3</maven.release.plugin.version>
    <maven.source.plugin.version>3.0.0</maven.source.plugin.version>
    <maven.nexus-staging.plugin.version>1.6.6</maven.nexus-staging.plugin.version>
    <maven.javadoc.plugin.version>2.10.3</maven.javadoc.plugin.version>
    <maven.gpg.plugin.version>1.6</maven.gpg.plugin.version>
    <maven.scm.gitexe.version>1.9.4</maven.scm.gitexe.version>
    
    <java.version>1.8</java.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

  </properties>

  <developers>
    <developer>
      <name>Martin O'Connor</name>
      <email>martin.oconnor@stanford.edu</email>
      <organization>Stanford Center for Biomedical Informatics Research</organization>
      <organizationUrl>http://bmir.stanford.edu</organizationUrl>
    </developer>
  </developers>

  <licenses>
    <license>
      <name>BSD 2-Clause License</name>
      <url>http://opensource.org/licenses/BSD-2-Clause</url>
    </license>
  </licenses>  

  <distributionManagement>
    <snapshotRepository>
      <id>sonatype-nexus-snapshots</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>
  </distributionManagement>

  <scm>
    <connection>scm:git:git@github.com:protegeproject/swrlapi-drools-engine.git</connection>
    <developerConnection>scm:git:git@github.com:protegeproject/swrlapi-drools-engine.git</developerConnection>
    <url>https://github.com/protegeproject/swrlapi</url>
    <tag>swrlapi-drools-engine-1.0.0-beta-21</tag>
  </scm>

  <issueManagement>
    <system>GitHub</system>
    <url>https://github.com/protegeproject/swrlapi-drools-engine/issues</url>
  </issueManagement>

  <dependencies>

    <dependency>
      <groupId>net.sourceforge.owlapi</groupId>
      <artifactId>owlapi-osgidistribution</artifactId>
      <version>${owlapi.version}</version>
    </dependency>

    <dependency>
      <groupId>edu.stanford.swrl</groupId>
      <artifactId>swrlapi</artifactId>
      <version>${swrlapi.version}</version>
    </dependency>

    <!-- Start of Drools dependencies -->

    <dependency>
      <groupId>org.drools</groupId>
      <artifactId>drools-osgi-integration</artifactId>
      <version>${drools.version}</version>
    </dependency>

    <!-- The SWRLAPI-based Drools engine uses the Drools 5 API.  -->
    <!-- The knowledge-api provides an adapter from the Drools 5 -->
    <!-- API to the Drools 6 KIE implementation.                 -->
    <dependency>
      <groupId>org.drools</groupId>
      <artifactId>knowledge-api</artifactId>
      <version>${drools.version}</version>
    </dependency>

    <!-- End of Drools dependencies -->

    <!-- Start of Checker Framework Dependencies -->
    
    <dependency>
      <groupId>org.checkerframework</groupId>
      <artifactId>checker</artifactId>
      <version>${checker.framework.version}</version>
    </dependency>

    <dependency>
      <groupId>org.checkerframework</groupId>
      <artifactId>checker-qual</artifactId>
      <version>${checker.framework.version}</version>
    </dependency>

    <dependency>
      <groupId>org.checkerframework</groupId>
      <artifactId>jdk8</artifactId>
      <version>${checker.framework.version}</version>
    </dependency>

    <!-- End of Checker Framework Dependencies -->
    
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>${slf4j.version}</version>
    </dependency>

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
      <version>${slf4j.version}</version>
      <scope>test</scope>
    </dependency>

  </dependencies>

  <build>

    <plugins>

      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>${maven.compiler.plugin.version}</version>
        <configuration>
          <source>${java.version}</source>
          <target>${java.version}</target>
          <!-- Checker Framework. Disabled for the moment. A few Checker-identified issues remain.
               <fork>true</fork>
               <annotationProcessors>
               <annotationProcessor>org.checkerframework.checker.nullness.NullnessChecker</annotationProcessor>
               </annotationProcessors>
               <compilerArgs>
               <arg>-Xbootclasspath/p:${annotatedJdk}</arg>
               </compilerArgs>
          -->
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>${maven.dependency.plugin.version}</version>
        <executions>
          <execution>
            <goals>
              <goal>properties</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>${maven.jar.plugin.version}</version>
        <configuration>
          <archive>                   
            <manifest>
              <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
              <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
            </manifest>
          </archive>
        </configuration>
      </plugin>

      <plugin>   
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <version>${maven.bundle.plugin.version}</version>
        <extensions>true</extensions>

        <configuration>

          <instructions>
            <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
            <Include-Resource>{maven-resources}</Include-Resource>
            <Import-Package>
              org.drools.*;version="${drools.version}",
              org.semanticweb.owlapi.*;version="[4.1.3,5.0.0)",
              org.swrlapi.*;version="1.0.0",
              *
            </Import-Package>
            <Export-Package>
              org.swrlapi.drools.*;version="1.0.0",
            </Export-Package>
          </instructions>
        </configuration>

        <executions>
          <execution>
            <id>bundle-manifest</id>
            <phase>process-classes</phase>
            <goals>    
              <goal>manifest</goal>
            </goals>   
          </execution>
        </executions>

      </plugin>

      <plugin>
        <artifactId>maven-release-plugin</artifactId>
        <version>${maven.release.plugin.version}</version>
        <dependencies>
	  <dependency>
	    <groupId>org.apache.maven.scm</groupId>
	    <artifactId>maven-scm-provider-gitexe</artifactId>
	    <version>${maven.scm.gitexe.version}</version>
	  </dependency>
        </dependencies>
      </plugin>

    </plugins>

  </build>

  <profiles>
    <profile>
      <id>release</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>

      <build>

        <plugins>

	  <plugin>
	    <groupId>org.apache.maven.plugins</groupId>
	    <artifactId>maven-source-plugin</artifactId>
            <version>${maven.source.plugin.version}</version>
	    <executions>
	      <execution>
	        <id>attach-sources</id>
	        <goals>
		  <goal>jar</goal>
	        </goals>
	      </execution>
	    </executions>
	  </plugin>
	  
	  <plugin>
	    <groupId>org.apache.maven.plugins</groupId>
	    <artifactId>maven-javadoc-plugin</artifactId>
	    <version>${maven.javadoc.plugin.version}</version>
	    <executions>
	      <execution>
	        <id>attach-javadocs</id>
	        <goals>
		  <goal>jar</goal>
	        </goals>
	        <configuration>
		  <failOnError>false</failOnError>
		  <quiet>true</quiet>
	        </configuration>
	      </execution>
	    </executions>
	  </plugin>
	  
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <version>${maven.jar.plugin.version}</version>
            <configuration>
              <archive>                   
                <manifest>
                  <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                  <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                </manifest>
              </archive>
            </configuration>
          </plugin>

	  <plugin>
	    <groupId>org.apache.maven.plugins</groupId>
	    <artifactId>maven-gpg-plugin</artifactId>
	    <version>${maven.gpg.plugin.version}</version>
	    <executions>
	      <execution>
	        <id>sign-artifacts</id>
	        <phase>verify</phase>
	        <goals>
		  <goal>sign</goal>
	        </goals>
	      </execution>
	    </executions>
	  </plugin>

          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>${maven.nexus-staging.plugin.version}</version>
            <extensions>true</extensions>
            <configuration>
              <serverId>ossrh</serverId>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
              <description>${project.version}</description>
              <autoReleaseAfterClose>true</autoReleaseAfterClose>
            </configuration>
          </plugin>

        </plugins>
      </build>
    </profile>
  </profiles>

</project>
