<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>uk.ac.sussex.gdsc</groupId>
    <artifactId>gdsc-ij-parent</artifactId>
    <version>1.0</version>
    <relativePath>../gdsc-ij-parent</relativePath>
  </parent>

  <artifactId>gdsc-smlm-parent</artifactId>
  <version>1.0.2</version>
  <packaging>pom</packaging>

  <name>GDSC SMLM library for single molecule localisation microscopy</name>
  <url>https://github.com/aherbert/gdsc-smlm</url>
  <organization>
    <name>Genome Damage and Stability Centre</name>
    <url>http://www.sussex.ac.uk/gdsc/</url>
  </organization>
  <description>Genome Damage and Stability Centre SMLM

Software for single molecule localisation microscopy (SMLM)
</description>

  <licenses>
    <license>
      <name>GNU General Public License (GPL) version 3.0</name>
      <url>http://www.gnu.org/licenses/gpl.txt</url>
      <distribution>manual</distribution>
    </license>
  </licenses>

  <inceptionYear>2011</inceptionYear>
  <scm>
    <connection>scm:git:git://github.com/aherbert/gdsc-smlm.git</connection>
    <developerConnection>scm:git:ssh://github.com/aherbert/gdsc-smlm.git</developerConnection>
    <url>https://github.com/aherbert/gdsc-smlm</url>
  </scm>
  <issueManagement>
    <system>GitHub Issues</system>
    <url>https://github.com/aherbert/gdsc-smlm/issues</url>
  </issueManagement>
  <ciManagement>
    <system>Travis CI</system>
    <url>https://travis-ci.com/aherbert/gdsc-smlm</url>
  </ciManagement>
  <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>
    <site>
      <id>${project.artifactId}-site</id>
      <url>file://${parent.dir}/mvn-repo</url>
    </site>
  </distributionManagement>
  <mailingLists>
    <mailingList>
      <name>ImageJ Forum</name>
      <archive>https://forum.image.sc/</archive>
    </mailingList>
  </mailingLists>

  <developers>
    <developer>
      <id>aherbert</id>
      <name>Alex Herbert</name>
      <email>a.herbert@sussex.ac.uk</email>
      <organization>GDSC</organization>
      <organizationUrl>http://www.sussex.ac.uk/gdsc/</organizationUrl>
      <roles>
        <role>developer</role>
      </roles>
    </developer>
  </developers>
  <contributors>
    <contributor>
      <name>Alex Herbert</name>
    </contributor>
  </contributors>

  <properties>
    <license.licenseName>gpl_v3</license.licenseName>
    <license.copyrightOwners>Alex Herbert</license.copyrightOwners>
    <license.excludes>${scijava.excludedLicensePatterns},
        **/*.json,
        **/*Protos.java,
        **/math3/**/*Copy.java,
        **/math3/**/PoissonDistribution.java,
        **/math3/**/CustomSimpsonIntegrator.java,
        **/math3/**/CustomPowellOptimizer.java,
        **/math3/**/BoundedNonLinearConjugateGradientOptimizer.java,
        **/math3/**/MultivariateGaussianMixtureExpectationMaximization.java
    </license.excludes>

    <gdsc.automatic.module.name>uk.ac.sussex.gdsc.smlm</gdsc.automatic.module.name>

    <!-- Workaround to avoid duplicating config files. -->
    <gdsc.parent.dir>${basedir}</gdsc.parent.dir>

    <!-- Dependency versions -->
    <gdsc.core.version>2.0.2</gdsc.core.version>
    <xstream.version>1.4.19</xstream.version>
    <ejml.version>0.24</ejml.version>
    <JTransforms.version>3.1</JTransforms.version>
    <protobuf.version>3.16.1</protobuf.version>
    <jsoup.version>1.15.3</jsoup.version>
    <mfl-core.version>0.5.6</mfl-core.version>

    <!-- Other maven plugin versions -->
    <protobuf-maven-plugin.version>0.6.1</protobuf-maven-plugin.version>
    <os-maven-plugin.version>1.6.0</os-maven-plugin.version>

  </properties>

  <dependencies>
    <dependency>
      <groupId>uk.ac.sussex.gdsc</groupId>
      <artifactId>gdsc-core</artifactId>
      <version>${gdsc.core.version}</version>
    </dependency>
    <dependency>
      <groupId>com.thoughtworks.xstream</groupId>
      <artifactId>xstream</artifactId>
      <version>${xstream.version}</version>
      <exclusions>
        <!-- XStream issue 117: Duplicate classes in xpp3_min and xmlpull (https://github.com/x-stream/xstream/issues/117).
          Current resolution is to ignore xmlpull. -->
        <exclusion>
          <groupId>xmlpull</groupId>
          <artifactId>xmlpull</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>com.googlecode.efficient-java-matrix-library</groupId>
      <artifactId>ejml</artifactId>
      <version>${ejml.version}</version>
    </dependency>
    <dependency>
      <groupId>com.github.wendykierp</groupId>
      <artifactId>JTransforms</artifactId>
      <version>${JTransforms.version}</version>
      <!-- <classifier>with-dependencies</classifier> -->
    </dependency>
    <dependency>
      <groupId>com.google.protobuf</groupId>
      <artifactId>protobuf-java</artifactId>
      <version>${protobuf.version}</version>
    </dependency>
    <dependency>
      <groupId>com.google.protobuf</groupId>
      <artifactId>protobuf-java-util</artifactId>
      <version>${protobuf.version}</version>
    </dependency>

    <!-- Managed dependencies -->
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-math3</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-rng-sampling</artifactId>
    </dependency>
    <dependency>
      <groupId>it.unimi.dsi</groupId>
      <artifactId>fastutil-core</artifactId>
    </dependency>

    <!-- TESTING -->
    <dependency>
      <groupId>uk.ac.sussex.gdsc</groupId>
      <artifactId>gdsc-test-api</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>uk.ac.sussex.gdsc</groupId>
      <artifactId>gdsc-test-utils</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>uk.ac.sussex.gdsc</groupId>
      <artifactId>gdsc-test-junit5</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>uk.ac.sussex.gdsc</groupId>
      <artifactId>gdsc-test-rng</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jsoup</groupId>
      <artifactId>jsoup</artifactId>
      <version>${jsoup.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <extensions>
      <extension>
        <!-- Generate a classifier for the current OS and architecture. Required for protocArtifact. -->
        <groupId>kr.motd.maven</groupId>
        <artifactId>os-maven-plugin</artifactId>
        <version>${os-maven-plugin.version}</version>
      </extension>
    </extensions>
    <pluginManagement>
      <plugins>

        <!-- This is added purely for testing against the latest 3D_Viewer SNAPSHOT <plugin> <artifactId>maven-enforcer-plugin</artifactId>
          <version>1.4.1</version> <executions> <execution> <id>enforce-rules</id> <goals> <goal>enforce</goal> </goals> <configuration>
          <skip>true</skip> </configuration> </execution> </executions> </plugin> -->

      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.xolstice.maven.plugins</groupId>
        <artifactId>protobuf-maven-plugin</artifactId>
        <version>${protobuf-maven-plugin.version}</version>
        <configuration>
          <protocArtifact>com.google.protobuf:protoc:${protobuf.version}:exe:${os.detected.classifier}</protocArtifact>
          <checkStaleness>true</checkStaleness>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>compile</goal>
              <goal>test-compile</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>
            <manifest>
              <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
              <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
            </manifest>
          </archive>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-source-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-sources</id>
            <phase>verify</phase>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>copy-dependencies</id>
            <phase>package</phase>
            <goals>
              <goal>copy-dependencies</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.directory}/dependencies</outputDirectory>
              <overWriteReleases>false</overWriteReleases>
              <overWriteSnapshots>true</overWriteSnapshots>
              <overWriteIfNewer>true</overWriteIfNewer>
              <excludeTransitive>false</excludeTransitive>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <configuration>
          <excludes>
            <!-- Auto generated code -->
            <exclude>**/*Protos.class</exclude>
            <exclude>**/*Protos$*.class</exclude>
            <!-- Add plugins with no testable code -->
          </excludes>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <configuration>
          <excludes>**\/*Protos.java</excludes>
        </configuration>
        <executions>
          <execution>
            <id>verify</id>
            <phase>verify</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>net.revelc.code.formatter</groupId>
        <artifactId>formatter-maven-plugin</artifactId>
        <configuration>
          <!-- Resource on the classpath. -->
          <configFile>eclipse/eclipse-code-format.xml</configFile>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-pmd-plugin</artifactId>
        <configuration>
          <!-- Ignore lower levels for now -->
          <minimumPriority>3</minimumPriority>
          <excludeFromFailureFile>${gdsc.parent.dir}/src/conf/pmd/exclude.properties</excludeFromFailureFile>
        </configuration>
      </plugin>
    </plugins>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
      </resource>
    </resources>
    <testResources>
      <testResource>
        <directory>src/test/resources</directory>
      </testResource>
    </testResources>
  </build>

  <reporting>
    <plugins>
      <plugin>
        <artifactId>maven-pmd-plugin</artifactId>
        <configuration>
          <!-- Ignore lower levels for now -->
          <minimumPriority>3</minimumPriority>
          <excludeFromFailureFile>${gdsc.parent.dir}/src/conf/pmd/exclude.properties</excludeFromFailureFile>
        </configuration>
      </plugin>  
    </plugins>
  </reporting>

  <modules>
    <module>gdsc-smlm</module>
    <module>gdsc-smlm-ij</module>
  </modules>

  <profiles>
    <profile>
      <id>eclipse-sources</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>add-source</id>
                <phase>generate-sources</phase>
                <goals>
                  <goal>add-source</goal>
                </goals>
                <configuration>
                  <sources>
                    <source>${project.build.directory}/generated-sources/java/</source>
                  </sources>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
