<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</artifactId>
  <version>1.0.0-beta-1</version>
  <packaging>bundle</packaging>
  <name>SWRLAPI</name>
  <description>Java API for working with SWRL rules and SQWRL queries</description>
  <url>https://github.com/protegeproject/swrlapi/wiki</url>

  <properties>

    <java.version>1.8</java.version> 

    <owlapi.version>4.1.3</owlapi.version> 
    <jep.version>2.4.0</jep.version>
    <axis.osgi.version>1.4_1</axis.osgi.version>
    <commons.discovery.osgi.version>0.4_1</commons.discovery.osgi.version>
    <com.google.guava.version>18.0</com.google.guava.version>

    <checker.framework.version>1.9.9</checker.framework.version>
    <annotatedJdk>${org.checkerframework:jdk8:jar}</annotatedJdk>
    <junit.version>4.11</junit.version>
    <org.hamcrest.core.version>1.3</org.hamcrest.core.version>
    <slf4j.version>1.7.13</slf4j.version>
    
    <maven.release.plugin.version>1.9</maven.release.plugin.version>
    <maven.compiler.plugin.version>2.3.2</maven.compiler.plugin.version>
    <maven.dependency.plugin.version>2.3</maven.dependency.plugin.version>
    <maven.bundle.plugin.version>2.5.4</maven.bundle.plugin.version>
    <maven.source.plugin.version>2.2.1</maven.source.plugin.version>
    <maven.release.plugin.version>2.5</maven.release.plugin.version>
    <maven.javadoc.plugin.version>2.9.1</maven.javadoc.plugin.version>
    <maven.gpg.plugin.version>1.5</maven.gpg.plugin.version>
    <maven.scm.gitexe.version>1.9</maven.scm.gitexe.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>  

  <!-- SWRLAPI libraries are hosted on Sonatype OSSRH (OSS Repository Hosting Service). -->
  <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>
  </distributionManagement>

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

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

    <!-- JARs not in public Maven repositories are put in local repository in ${project.basedir}/lib. -->
    <!-- Each project ./lib directory can contain a repository of this type.                          -->
    <!-- See: http://blog.dub.podval.org/2010/01/maven-in-project-repository.html                     -->
    <repository>
      <id>lib</id>
      <name>lib</name>
      <releases>
        <enabled>true</enabled>
        <checksumPolicy>ignore</checksumPolicy>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <url>file://${project.basedir}/lib</url>
    </repository>

  </repositories>
  
  <dependencies>

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

    <!-- 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.guava</groupId>
      <artifactId>guava</artifactId>
      <version>${com.google.guava.version}</version>
    </dependency>
    
    <!-- In local project repository (./lib) because we could not find a public Maven repository containing it. -->
    <dependency>
      <groupId>org.nfunk</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-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>
          <!--
              <fork>true</fork>
              <annotationProcessors>
              <annotationProcessor>org.checkerframework.checker.nullness.NullnessChecker</annotationProcessor>
              </annotationProcessors>
              <compilerArgs>
              <arg>-Xbootclasspath/p:${annotatedJdk}</arg>
              </compilerArgs>
          -->
        </configuration>
      </plugin>

      <plugin>
        <!-- This plugin will set properties values using dependency information -->
        <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.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.semanticweb.owlapi.*;version="[4.1.3,5.0.0)",
              *
            </Import-Package>
            <Export-Package>
              org.nfunk.*;version="${jep.version}",
              org.swrlapi.*;version="1.0.0"
            </Export-Package>
            <Embed-Transitive>true</Embed-Transitive>
            <Embed-Dependency>jep;version="${jep.version}"</Embed-Dependency>
          </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>prepare-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-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>
        </plugins>

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

</project>
