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

  <description>
        Pure Java implementation NFSv3, v4 and v4.1
  </description>

  <developers>
    <developer>
      <name>The dCache project</name>
      <organization>dCache</organization>
      <organizationUrl>https://dcache.org</organizationUrl>
    </developer>
  </developers>

  <groupId>org.dcache</groupId>
  <artifactId>nfs4j</artifactId>
  <version>0.28.4</version>
  <name>Java based NFSv4.1 implementation</name>
  <packaging>pom</packaging>

  <url>http://www.dCache.ORG</url>

  <scm>
      <url>https://github.com/dCache/nfs4j.git</url>
      <connection>scm:git:https://github.com/dCache/nfs4j.git</connection>
      <developerConnection>scm:git:ssh://git@github.com/dCache/nfs4j.git</developerConnection>
    <tag>nfs4j-0.28.4</tag>
  </scm>

  <!--
    CODE LICENSE
  -->
  <licenses>
    <license>
      <name>
        GNU Lesser General Public License
      </name>
      <url>
        http://www.fsf.org/licensing/licenses/lgpl.txt
      </url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <modules>
      <module>core</module>
      <module>basic-client</module>
      <module>dlm</module>
      <module>benchmarks</module>
      <module>basic-server</module>
      <module>rquota</module>
  </modules>

  <properties>
      <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
      <java.version>17</java.version>
      <maven.javadoc.failOnError>false</maven.javadoc.failOnError>
  </properties>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-pmd-plugin</artifactId>
          <version>3.14.0</version>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.10.1</version>
            <configuration>
                <showDeprecation>true</showDeprecation>
                <release>${java.version}</release>
            </configuration>
        </plugin>
	<plugin>
	    <groupId>org.apache.maven.plugins</groupId>
	    <artifactId>maven-release-plugin</artifactId>
	    <version>3.0.1</version>
        <configuration>
            <useReleaseProfile>true</useReleaseProfile>
        </configuration>
	    <dependencies>
		<dependency>
		    <groupId>org.apache.maven.scm</groupId>
		    <artifactId>maven-scm-provider-gitexe</artifactId>
		    <version>2.0.1</version>
		</dependency>
	    </dependencies>
	</plugin>
        <plugin>
            <groupId>com.github.spotbugs</groupId>
            <artifactId>spotbugs-maven-plugin</artifactId>
            <version>4.7.3.0</version>
            <configuration>
               <excludeFilterFile>${maven.multiModuleProjectDirectory}/spotbugs-exclude.xml</excludeFilterFile>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <version>0.8.14</version>
            <executions>
                <!--
                    Prepares the property pointing to the JaCoCo runtime agent which
                    is passed as VM argument when Maven the Surefire plugin is executed.
                -->
                <execution>
                    <id>pre-unit-test</id>
                    <goals>
                        <goal>prepare-agent</goal>
                    </goals>
                    <configuration>
                        <!-- Sets the path to the file which contains the execution data. -->
                        <destFile>${project.build.directory}/coverage-reports/jacoco-ut.exec</destFile>
                    </configuration>
                </execution>
                <!--
                    Ensures that the code coverage report for unit tests is created after
                    unit tests have been run.
                -->
                <execution>
                    <id>post-unit-test</id>
                    <phase>test</phase>
                    <goals>
                        <goal>report</goal>
                    </goals>
                    <configuration>
                        <!-- Sets the path to the file which contains the execution data. -->
                        <dataFile>${project.build.directory}/coverage-reports/jacoco-ut.exec</dataFile>
                        <!-- Sets the output directory for the code coverage report. -->
                        <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory>
                    </configuration>
                </execution>
            </executions>
        </plugin>

        <plugin>
            <groupId>org.sonatype.central</groupId>
            <artifactId>central-publishing-maven-plugin</artifactId>
            <version>0.9.0</version>
            <extensions>true</extensions>
            <configuration>
                <publishingServerId>central</publishingServerId>
            </configuration>
        </plugin>

    </plugins>
  </build>

  <!--
    EXTERNAL DEPENDENCIES
  -->
  <dependencyManagement>
      <dependencies>
          <dependency>
              <groupId>com.google.jimfs</groupId>
              <artifactId>jimfs</artifactId>
              <version>1.3.1</version>
              <scope>test</scope>
          </dependency>
          <dependency>
              <groupId>org.jline</groupId>
              <artifactId>jline</artifactId>
              <version>3.14.0</version>
          </dependency>
          <dependency>
              <groupId>junit</groupId>
              <artifactId>junit</artifactId>
              <version>4.13.1</version>
              <scope>test</scope>
          </dependency>
          <dependency>
              <groupId>org.mockito</groupId>
              <artifactId>mockito-core</artifactId>
              <version>5.18.0</version>
              <scope>test</scope>
          </dependency>
          <dependency>
              <groupId>org.hamcrest</groupId>
              <artifactId>hamcrest-core</artifactId>
              <version>2.1</version>
              <scope>test</scope>
          </dependency>
          <dependency>
              <groupId>org.slf4j</groupId>
              <artifactId>slf4j-api</artifactId>
              <version>1.7.25</version>
          </dependency>
          <dependency>
              <groupId>org.slf4j</groupId>
              <artifactId>log4j-over-slf4j</artifactId>
              <version>1.7.25</version>
          </dependency>
          <dependency>
              <groupId>ch.qos.logback</groupId>
              <artifactId>logback-classic</artifactId>
              <version>1.2.13</version>
          </dependency>
          <dependency>
              <groupId>com.google.guava</groupId>
              <artifactId>guava</artifactId>
              <version>32.0.0-jre</version>
          </dependency>
          <dependency>
              <groupId>org.dcache</groupId>
              <artifactId>oncrpc4j-core</artifactId>
              <version>3.4.3</version>
          </dependency>
          <dependency>
              <groupId>com.hazelcast</groupId>
              <artifactId>hazelcast</artifactId>
              <version>5.3.5</version>
          </dependency>
          <dependency>
              <groupId>com.sleepycat</groupId>
              <artifactId>je</artifactId>
              <version>18.3.12</version>
          </dependency>
          <dependency>
              <groupId>org.openjdk.jmh</groupId>
              <artifactId>jmh-core</artifactId>
              <version>1.21</version>
          </dependency>
          <dependency>
              <groupId>org.openjdk.jmh</groupId>
              <artifactId>jmh-generator-annprocess</artifactId>
              <version>1.21</version>
          </dependency>
          <dependency>
              <groupId>info.picocli</groupId>
              <artifactId>picocli</artifactId>
              <version>4.7.4</version>
          </dependency>
          <dependency>
              <groupId>com.boundary</groupId>
              <artifactId>high-scale-lib</artifactId>
              <version>1.0.6</version>
          </dependency>
      </dependencies>
  </dependencyManagement>

  <profiles>
      <profile>
          <id>sign-artifacts</id>
          <activation>
              <property>
                  <name>performRelease</name>
                  <value>true</value>
              </property>
          </activation>
          <build>
              <plugins>
                  <plugin>
                      <groupId>org.apache.maven.plugins</groupId>
                      <artifactId>maven-gpg-plugin</artifactId>
                      <version>1.6</version>
                      <configuration>
                          <passphrase>${gpg.passphrase}</passphrase>
                      </configuration>
                      <executions>
                          <execution>
                              <id>sign-artifacts</id>
                              <phase>verify</phase>
                              <goals>
                                  <goal>sign</goal>
                              </goals>
                          </execution>
                      </executions>
                  </plugin>
              </plugins>
          </build>
      </profile>
      <profile>
            <id>reformat</id>
            <activation>
                <property>
                    <name>reformat</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>net.revelc.code</groupId>
                        <artifactId>impsort-maven-plugin</artifactId>
                        <version>1.12.0</version>
                        <executions>
                            <execution>
                                <id>sort-imports</id>
                                <goals>
                                    <goal>sort</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <groups>java.,javax.,org.,com.</groups>
                            <staticGroups>java,*</staticGroups>
                            <excludes>
                                <exclude>**/thrift/*.java</exclude>
                                <exclude>**/*generated*/*.java</exclude>
                            </excludes>
                            <includes>
                                <include>org/dcache/**/*.java</include>
                            </includes>
                            <compliance>${java.version}</compliance>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>net.revelc.code.formatter</groupId>
                        <artifactId>formatter-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>format-sourcecode</id>
                                <configuration>
                                    <skip>${formatter.skip}</skip>
                                </configuration>
                                <goals>
                                    <goal>format</goal>
                                </goals>
                            </execution>
                        </executions>
                        <version>2.26.0</version>
                        <configuration>
                            <compilerCompliance>${java.version}</compilerCompliance>
                            <compilerSource>${java.version}</compilerSource>
                            <compilerTargetPlatform>${java.version}</compilerTargetPlatform>
                            <lineEnding>LF</lineEnding>
                            <configFile>
                                ${maven.multiModuleProjectDirectory}/nfs4j-formatter.xml
                            </configFile>
                            <includes>
                                <include>org/dcache/**/*.java</include>
                            </includes>
                            <directories>
                                <directory>src/main/java</directory>
                                <directory>src/test/java</directory>
                            </directories>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
