<?xml version="1.0" encoding="UTF-8"?>

<!--
  ~ Copyright (c) 2016 Dmitry Avtonomov
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~    http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns="http://maven.apache.org/POM/4.0.0"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <!-- ======================================================= -->
  <!-- Artifact Coordinates -->
  <!-- ======================================================= -->

  <parent>
    <groupId>com.github.chhh</groupId>
    <artifactId>sonatype-ossrh-parent</artifactId>
    <version>0.1</version>
    <!--<relativePath>../../sonatype-ossrh</relativePath>-->
  </parent>

  <groupId>com.github.chhh</groupId>
  <artifactId>msftbx</artifactId>
  <version>1.8.7</version>
  <packaging>jar</packaging>

  <name>MSFTBX</name>
  <description>MSFTBX - Mass Spectrometry File Tool Box</description>
  <url>https://github.com/chhh/msftbx</url>


  <scm>
    <connection>${scm.url}</connection>
    <developerConnection>${scm.url}</developerConnection>
    <url>${scm.url}</url>
    <tag>1.8.7</tag>
  </scm>


  <properties>
    <source.version>1.8</source.version>
    <target.version>1.8</target.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <scm.url>scm:git:https://github.com/chhh/msftbx.git</scm.url>
  </properties>

  <developers>
    <developer>
      <id>chhh</id>
      <name>Dmitry Avtonomov</name>
      <url>https://github.com/chhh/</url>
      <roles>
        <role>author</role>
        <role>maintainer</role>
      </roles>
    </developer>
  </developers>

  <!-- ======================================================= -->
  <!-- Dependencies -->
  <!-- ======================================================= -->
  <dependencies>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>1.7.25</version>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-simple</artifactId>
      <version>1.7.25</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>26.0-jre</version>
      <exclusions>
        <exclusion>
          <artifactId>animal-sniffer-annotations</artifactId>
          <groupId>org.codehaus.mojo</groupId>
        </exclusion>
        <exclusion>
          <artifactId>j2objc-annotations</artifactId>
          <groupId>com.google.j2objc</groupId>
        </exclusion>
        <exclusion>
          <artifactId>error_prone_annotations</artifactId>
          <groupId>com.google.errorprone</groupId>
        </exclusion>
        <exclusion>
          <artifactId>jsr305</artifactId>
          <groupId>com.google.code.findbugs</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-pool2</artifactId>
      <version>2.6.0</version>
    </dependency>
    <dependency>
      <groupId>com.github.chhh</groupId>
      <artifactId>javolution-core-java-msftbx</artifactId>
      <version>6.11.8</version>
    </dependency>
    <dependency>
      <groupId>org.biojava</groupId>
      <artifactId>biojava-ontology</artifactId>
      <version>5.1.0</version>
      <exclusions>
        <exclusion>
          <groupId>org.slf4j</groupId>
          <artifactId>slf4j-api</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.apache.logging.log4j</groupId>
          <artifactId>log4j-slf4j-impl</artifactId>
        </exclusion>
        <exclusion>
          <artifactId>log4j-core</artifactId>
          <groupId>org.apache.logging.log4j</groupId>
        </exclusion>
        <exclusion>
          <artifactId>log4j-api</artifactId>
          <groupId>org.apache.logging.log4j</groupId>
        </exclusion>
      </exclusions>
    </dependency>

    <!-- "java.xml.bind" is removed from Java 9+. Need to add JAXB API + implementation. -->
    <!-- JAXB 2.3.x for jdk9+ -->
    <dependency>
      <groupId>javax.xml.bind</groupId>
      <artifactId>jaxb-api</artifactId>
      <version>2.3.1</version>
    </dependency>
    <dependency>
      <groupId>org.glassfish.jaxb</groupId>
      <artifactId>jaxb-runtime</artifactId>
      <version>2.3.1</version>
    </dependency>
    <!-- JAXB needs javax.activation module (jdk9) -->
    <dependency>
      <groupId>javax.activation</groupId>
      <artifactId>javax.activation-api</artifactId>
      <version>1.2.0</version>
    </dependency>

    <!--Test dependencies-->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.12</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-model</artifactId>
      <version>3.5.4</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <!--<sourceDirectory>src/main/java</sourceDirectory>-->
    <!--<testSourceDirectory>src/test/java</testSourceDirectory>-->

    <!--<testResources>-->
      <!--<testResource>-->
        <!--<directory>src/test/resources</directory>-->
      <!--</testResource>-->
    <!--</testResources>-->

    <!-- ======================================================= -->
    <!-- Resources -->
    <!-- ======================================================= -->
    <resources>
      <resource>
        <directory>src/main/java</directory>
        <excludes>
          <exclude>**/*.java</exclude>
        </excludes>
        <includes>
          <include>**/*.properties</include>
          <include>**/*.obo</include>
        </includes>
      </resource>
    </resources>


    <plugins>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.7.0</version>
        <configuration>
          <source>${source.version}</source>
          <target>${target.version}</target>
          <encoding>${project.build.sourceEncoding}</encoding>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>2.10.4</version>
        <configuration>
          <excludePackageNames>javax.*,*.internal,*.jaxb,*.com4j</excludePackageNames>
          <failOnError>false</failOnError>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <version>3.1.0</version>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.0.1</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <version>3.2.0</version>
        <configuration>
          <minimizeJar>true</minimizeJar>
          <filters>
            <filter>
              <artifact>javax.xml.bind:jaxb-api</artifact>
              <includes><include>**</include></includes>
            </filter>
            <filter>
              <artifact>org.glassfish.jaxb:jaxb-runtime</artifact>
              <includes><include>**</include></includes>
            </filter>
            <!--START DEPS of Glassfish-JAXB-->
            <filter>
              <artifact>com.sun.istack:istack-commons-runtime</artifact>
              <includes><include>**</include></includes>
            </filter>
            <!--END   DEPS of Glassfish-JAXB-->
            <filter>
              <artifact>javax.activation:javax.activation-api</artifact>
              <includes><include>**</include></includes>
            </filter>
          </filters>
          <shadedArtifactAttached>true</shadedArtifactAttached>
          <shadedClassifierName>with-deps</shadedClassifierName>
        </configuration>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>

  </build>

</project>
