<?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-parent</artifactId>
  <version>2.0.2</version>
  <packaging>pom</packaging>

  <name>SWRLAPI Parent POM</name>
  <description>Parent POM for SWRLAPI Project</description>

  <properties>

    <swrlapi.version>${project.version}</swrlapi.version>
    <swrlapi.drools.version>${project.version}</swrlapi.drools.version>
    <protege.version>5.2.0</protege.version>
    <owlapi.version>4.2.8</owlapi.version>
    <drools.version>6.5.0.Final</drools.version>
    <jep.version>2.4.2</jep.version>
    <axis.osgi.version>1.4_2</axis.osgi.version>
    <commons.discovery.osgi.version>0.4_1</commons.discovery.osgi.version>
    <!-- Version 19.0 seems to cause conflicts in Protege plugin -->
    <com.google.guava.version>18.0</com.google.guava.version>
    <com.google.findbugs.version>3.0.1</com.google.findbugs.version>

    <!-- Version 2.0.0 of the Checker Framework causes OSGi issues in Protege plugin -->
    <checker.framework.version>1.9.13</checker.framework.version>
    <annotatedJdk>${org.checkerframework:jdk8:jar}</annotatedJdk>
    <junit.version>4.12</junit.version>
    <org.hamcrest.core.version>1.3</org.hamcrest.core.version>
    <slf4j.version>1.7.21</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>
    <!-- Version 3.0.0 and 3.0.1 of the Maven Bundle Plugin does not embed depenedencies properly -->
    <maven.bundle.plugin.version>2.5.4</maven.bundle.plugin.version>
    <maven.install.plugin.version>2.5.2</maven.install.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.7</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>
    <maven.failsafe.plugin.version>2.19.1</maven.failsafe.plugin.version>
    <maven.deploy.plugin.version>2.8.2</maven.deploy.plugin.version>
    <maven.versions.plugin.version>2.1</maven.versions.plugin.version>
    <maven.resources.plugin.version>3.0.2</maven.resources.plugin.version>
    <maven.clean.plugin.version>3.0.0</maven.clean.plugin.version>
    <exec.maven.plugin.version>1.5.0</exec.maven.plugin.version>
    
    <java.version>1.8</java.version>

    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    
  </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>  

  <!-- SWRLAPI libraries are hosted on Sonatype OSSRH (OSS Repository Hosting Service). -->
  <distributionManagement>
    <snapshotRepository>
      <id>central-nexus-snapshots</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
    <repository>
      <id>central-nexus-staging</id>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
  </distributionManagement>

  <scm>
    <connection>scm:git:git@github.com:protegeproject/swrlapi-parent.git</connection>
    <developerConnection>scm:git:git@github.com:protegeproject/swrlapi-parent.git</developerConnection>
    <url>https://github.com/protegeproject/swrlapi-parent</url>
    <tag>release-2.0.2</tag>
  </scm>

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

  <dependencyManagement>
    <dependencies>

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

      <!-- Start of Protege dependencies -->

      <dependency>
        <groupId>edu.stanford.protege</groupId>
        <artifactId>protege-common</artifactId>
        <version>${protege.version}</version>
      </dependency>

      <dependency>
        <groupId>edu.stanford.protege</groupId>
        <artifactId>protege-editor-core</artifactId>
        <version>${protege.version}</version>
      </dependency>

      <dependency>
        <groupId>edu.stanford.protege</groupId>
        <artifactId>protege-editor-owl</artifactId>
        <version>${protege.version}</version>
      </dependency>

      <!-- End of Protege dependencies -->

      <!-- Start of Drools dependencies -->

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

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

      <!-- End of Drools dependencies -->

      <!-- OSGi Bundle for Axis 1.4 -->
      <dependency>
        <groupId>org.apache.geronimo.bundles</groupId>
        <artifactId>axis</artifactId>
        <version>${axis.osgi.version}</version>
      </dependency>

      <!-- OSGi Bundle for Apache Commons Discovery 0.4  -->
      <dependency>
        <groupId>org.apache.geronimo.bundles</groupId>
        <artifactId>commons-discovery</artifactId>
        <version>${commons.discovery.osgi.version}</version>
      </dependency>

      <dependency>
        <groupId>com.google.code.findbugs</groupId>
        <artifactId>jsr305</artifactId>
        <version>${com.google.findbugs.version}</version>
      </dependency>

      <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>${com.google.guava.version}</version>
      </dependency>
      
      <dependency>
        <groupId>org.scijava</groupId>
        <artifactId>jep</artifactId>
        <version>${jep.version}</version>
      </dependency>

      <!-- 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.hamcrest</groupId>
        <artifactId>hamcrest-core</artifactId>
        <version>${org.hamcrest.core.version}</version>
      </dependency>

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

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

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

    </dependencies>
  </dependencyManagement>

  <build>
    <sourceDirectory>src/main/java</sourceDirectory>
    <testSourceDirectory>src/test/java</testSourceDirectory>

    <pluginManagement>
      <plugins>

        <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>${maven.compiler.plugin.version}</version>
          <configuration>
            <source>${java.version}</source>
            <target>${java.version}</target>
            <!-- Temporarily disabling Checker Framework. A small number 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-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>

        <plugin>   
          <groupId>org.apache.felix</groupId>
          <artifactId>maven-bundle-plugin</artifactId>
          <version>${maven.bundle.plugin.version}</version>
        </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-resources-plugin</artifactId>
          <version>${maven.resources.plugin.version}</version>
        </plugin>

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

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

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

        <plugin>
  	  <groupId>org.codehaus.mojo</groupId>
	  <artifactId>exec-maven-plugin</artifactId>
          <version>${exec.maven.plugin.version}</version>
        </plugin>

        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>versions-maven-plugin</artifactId>
        </plugin>


      </plugins>
    </pluginManagement>
  </build>

  <profiles>
    <profile>
      <id>maven-central-release</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>

      <distributionManagement>

        <snapshotRepository>
          <id>central-nexus-snapshots</id>
          <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
          <id>central-nexus-releases</id>
          <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>

      </distributionManagement>

      <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-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>central-nexus-releases</serverId>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
              <description>${project.version}</description>
              <autoReleaseAfterClose>true</autoReleaseAfterClose>
            </configuration>
          </plugin>

        </plugins>

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

</project>
