<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>

  <groupId>se.jiderhamn.classloader-leak-prevention</groupId>
  <artifactId>classloader-leak-prevention-parent</artifactId>
  <version>2.7.0</version>
  <packaging>pom</packaging>
  <name>ClassLoader Leak Prevention library parent</name>
  <description>Library that prevents ClassLoader leaks / java.lang.OutOfMemoryError: PermGen space</description>
  <url>https://github.com/mjiderhamn/classloader-leak-prevention</url>
  
  <scm>
    <connection>scm:git:git@github.com:mjiderhamn/classloader-leak-prevention.git</connection>
    <developerConnection>scm:git:git@github.com:mjiderhamn/classloader-leak-prevention.git</developerConnection>
    <url>https://github.com/mjiderhamn/classloader-leak-prevention.git</url>
    <tag>classloader-leak-prevention-parent-2.7.0</tag>
  </scm>

  <!-- Configure Release: http://central.sonatype.org/pages/apache-maven.html -->
  <distributionManagement>
    <snapshotRepository>
      <id>sonatype-nexus-snapshots</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
    <repository>
      <id>sonatype-nexus-staging</id>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
  </distributionManagement>

  <licenses>
    <license>
      <name>Apache 2</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>manual</distribution>
    </license>
  </licenses>
  
  <modules>
    <module>classloader-leak-prevention-core</module>
    <module>classloader-leak-prevention-servlet</module>
    <module>classloader-leak-prevention-servlet3</module>
  </modules>

  <developers>
    <developer>
      <id>mjiderhamn</id>
      <name>Mattias Jiderhamn</name>
    </developer>
  </developers>   

  <properties>
    <!-- Disable strict JavaDoc checking, as per http://blog.joda.org/2014/02/turning-off-doclint-in-jdk-8-javadoc.html -->
    <additionalparam>-Xdoclint:none</additionalparam>
  </properties>

  <repositories>
    <!-- GeoTools -->
    <repository>
      <id>osgeo</id>
      <name>Open Source Geospatial Foundation Repository</name>
      <url>http://download.osgeo.org/webdav/geotools/</url>
    </repository>
  </repositories>

  <dependencies>
    <!-- Dependencies for creating tests -->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.12</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-library</artifactId>
      <version>1.3</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <version>2.5.3</version>
          <configuration>
            <mavenExecutorId>forked-path</mavenExecutorId>
            <useReleaseProfile>false</useReleaseProfile>
            <arguments>-Prelease</arguments>
            <autoVersionSubmodules>true</autoVersionSubmodules>
            <!-- Avoid cloning from remote repo when releasing -->
            <localCheckout>true</localCheckout>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.6.1</version>
        <configuration>
          <source>1.6</source>
          <target>1.6</target>
          <fork>true</fork>
          <!-- Allow compiling against com.sun.xml.internal classes -->
          <testCompilerArgument>-XDignore.symbol.file</testCompilerArgument>
        </configuration>
      </plugin>
      <!-- Since the tests may register (leaking) references in system classes, we need a new JVM for each test -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.19.1</version>
        <configuration>
          <forkCount>2</forkCount>
          <reuseForks>false</reuseForks>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <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-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>2.10.4</version>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.6</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>