<?xml version="1.0" encoding="UTF-8"?>
<!--
 ~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MIT License ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ~ 
 ~ Copyright (c) 2017-2019 SNF4J contributors
 ~ 
 ~ Permission is hereby granted, free of charge, to any person obtaining a copy
 ~ of this software and associated documentation files (the "Software"), to deal
 ~ in the Software without restriction, including without limitation the rights
 ~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 ~ copies of the Software, and to permit persons to whom the Software is
 ~ furnished to do so, subject to the following conditions:
 ~ 
 ~ The above copyright notice and this permission notice shall be included in all
 ~ copies or substantial portions of the Software.
 ~ 
 ~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 ~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 ~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 ~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 ~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 ~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 ~ SOFTWARE.
 ~
 ~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 -->
<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>org.snf4j</groupId>
  <artifactId>snf4j-project</artifactId>
  <version>1.2.0</version>
  <packaging>pom</packaging>
 
  <name>SNF4J</name>
  <description>Top SNF4J project</description>
  <url>http://snf4j.org</url>
  <inceptionYear>2017</inceptionYear>
  
  <organization>
    <name>SNF4J.ORG</name> 
    <url>http://snf4j.org</url> 
  </organization>
  
  <licenses>
    <license>
      <name>MIT License</name> 
      <url>http://www.opensource.org/licenses/mit-license.php</url> 
      <distribution>repo</distribution> 
    </license>
  </licenses>

  <scm>
    <url>https://github.com/snf4j/snf4j</url>
    <connection>scm:git:git://github.com/snf4j/snf4j.git</connection>
  </scm>  
  
  <developers>
    <developer>
      <name>The SNF4J Contributors</name>
      <email>snf4j@snf4j.org</email>
      <url>http://snf4j.org/</url>
      <organization>SNF4J.ORG</organization>
      <organizationUrl>http://snf4j.org</organizationUrl>
    </developer>
  </developers>
  
  <properties>
    <arguments />
    <version.java>1.6</version.java>
    <version.compiler.source>${version.java}</version.compiler.source>
    <version.compiler.target>${version.java}</version.compiler.target>
    
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.build.resourceEncoding>UTF-8</project.build.resourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    
    <!-- jar OSGi versions -->
    <slf4j.osgiVersion>1.7.1</slf4j.osgiVersion>
    <log4j2.osgiVersion>2.0.2</log4j2.osgiVersion>
    
    <!-- jar versions -->
    <version.junit>4.10</version.junit>
    <version.slf4j>1.7.21</version.slf4j>
    <version.slf4j.api>${version.slf4j}</version.slf4j.api>
    <version.slf4j.simple>${version.slf4j}</version.slf4j.simple>
    <version.log4j2>2.11.2</version.log4j2>
    <version.log4j2.api>${version.log4j2}</version.log4j2.api>
    <version.log4j2.core>${version.log4j2}</version.log4j2.core>

    <!-- plugin versions -->
    <version.compiler.plugin>2.5.1</version.compiler.plugin>
    <version.jar.plugin>2.3.1</version.jar.plugin>
    <version.surefire.plugin>2.9</version.surefire.plugin>
    <version.build.helper.plugin>1.7</version.build.helper.plugin>
    <version.antrun.plugin>1.3</version.antrun.plugin>
    <version.clean.plugin>2.5</version.clean.plugin>
    <version.resources.plugin>2.6</version.resources.plugin>
    <version.cobertura.plugin>2.7</version.cobertura.plugin>
    <version.javadoc.plugin>2.10.4</version.javadoc.plugin>
    <version.source.plugin>3.0.1</version.source.plugin>
    <version.nexus.staging.plugin>1.6.7</version.nexus.staging.plugin>
    <version.versions.plugin>2.7</version.versions.plugin>
    <version.gpg.plugin>1.5</version.gpg.plugin>

  </properties>

  <modules>
    <module>snf4j-core</module>
    <module>snf4j-core-slf4j</module>
    <module>snf4j-core-log4j2</module>
    <module>snf4j-example</module>
  </modules>
  
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${version.junit}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

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

  <build>
    <resources>
      <resource>
        <directory>${project.basedir}/src/main/resources</directory>
        <filtering>true</filtering>
      </resource>
    </resources>

    <plugins>
    
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>versions-maven-plugin</artifactId>
        <version>${version.versions.plugin}</version>
      </plugin>

      <plugin>
        <groupId>org.sonatype.plugins</groupId>
        <artifactId>nexus-staging-maven-plugin</artifactId>
        <version>${version.nexus.staging.plugin}</version>
        <extensions>true</extensions>
        <configuration>
          <serverId>ossrh</serverId>
          <nexusUrl>https://oss.sonatype.org/</nexusUrl>
          <autoReleaseAfterClose>false</autoReleaseAfterClose>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-clean-plugin</artifactId>
        <version>${version.clean.plugin}</version>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>${version.javadoc.plugin}</version>
        <configuration>
          <aggregate>false</aggregate>
          <stylesheet>java</stylesheet>
          <links>
            <link>http://java.sun.com/j2se/1.5.0/docs/api</link>
          </links>
          <groups>
            <group>
              <title>SNF4J packages</title>
              <packages>org.snf4j:org.snf4j.*</packages>
            </group>
          </groups>
        </configuration>
      </plugin>     
      
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <version>${version.resources.plugin}</version>
      </plugin>
      
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${version.surefire.plugin}</version>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>${version.compiler.plugin}</version>
        <configuration>
          <source>${version.compiler.source}</source>
          <target>${version.compiler.target}</target>
          <excludes>
            <exclude>**/package-info.java</exclude>
          </excludes>
        </configuration>
      </plugin>
      
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>${version.build.helper.plugin}</version>
        <executions>
          <execution>
            <id>parse-version</id>
            <goals>
              <goal>parse-version</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>${version.jar.plugin}</version>
        <configuration>
          <archive>
            <manifestEntries>
              <Bundle-Name>${project.name}</Bundle-Name> 
              <Bundle-Version>${parsedVersion.osgiVersion}</Bundle-Version>
              <Bundle-Description>${project.description}</Bundle-Description>
              <Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName> 
              <Bundle-Vendor>${project.organization.name}</Bundle-Vendor> 
              <X-Compile-Source-JDK>${version.compiler.source}</X-Compile-Source-JDK>
              <X-Compile-Target-JDK>${version.compiler.target}</X-Compile-Target-JDK>
              <Implementation-Version>${project.version}</Implementation-Version>
            </manifestEntries>
            <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
          </archive>
          <skipIfEmpty>true</skipIfEmpty>
        </configuration>
      </plugin>
      
      <plugin>
        <artifactId>maven-source-plugin</artifactId> 
        <version>${version.source.plugin}</version> 
        <configuration>
          <archive>
            <manifestEntries>
              <Bundle-ManifestVersion>2</Bundle-ManifestVersion> 
              <Bundle-Name>${project.name}</Bundle-Name> 
              <Bundle-SymbolicName>${project.groupId}.${project.artifactId}.source</Bundle-SymbolicName> 
              <Bundle-Vendor>${project.organization.name}</Bundle-Vendor> 
              <Bundle-Version>${project.version}</Bundle-Version> 
              <Bundle-Description>${project.description}</Bundle-Description>
            </manifestEntries>
          </archive>
        </configuration>
      </plugin>
      
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>cobertura-maven-plugin</artifactId>
        <version>${version.cobertura.plugin}</version>
        <configuration>
          <formats>
            <format>html</format>
            <format>xml</format>
          </formats>
          <check>
            <haltOnFailure>true</haltOnFailure>
          </check>
        </configuration>
      </plugin>

    </plugins>    
  </build>

  <profiles>
  
    <profile> 
      <id>release</id>
        <build>
          <plugins>
           <plugin>
             <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-gpg-plugin</artifactId>
               <version>${version.gpg.plugin}</version>
               <executions>
                 <execution>
                   <id>sign-artifacts</id>
                   <phase>verify</phase>
                   <goals>
                     <goal>sign</goal>
                   </goals>
                 </execution>
               </executions>
            </plugin>

            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-javadoc-plugin</artifactId>
              <version>${version.javadoc.plugin}</version>
              <executions>
                <execution>
                  <id>attach-javadocs</id>
                  <goals>
                    <goal>jar</goal>
                  </goals>
                </execution>
              </executions>        
              <configuration>
                <aggregate>false</aggregate>
                <stylesheet>java</stylesheet>
                <links>
                  <link>http://java.sun.com/j2se/1.5.0/docs/api</link>
                </links>
                <groups>
                  <group>
                    <title>SNF4J packages</title>
                    <packages>org.snf4j:org.snf4j.*</packages>
                  </group>
                </groups>
              </configuration>
            </plugin>     

            <plugin>
              <artifactId>maven-source-plugin</artifactId> 
              <version>${version.source.plugin}</version>
              <executions>
                <execution>
                  <id>attach-sources</id>
                  <goals>
                    <goal>jar-no-fork</goal>
                  </goals>
                </execution>
              </executions>
              <configuration>
                <archive>
                  <manifestEntries>
                    <Bundle-ManifestVersion>2</Bundle-ManifestVersion> 
                    <Bundle-Name>${project.name}</Bundle-Name> 
                    <Bundle-SymbolicName>${project.groupId}.${project.artifactId}.source</Bundle-SymbolicName> 
                    <Bundle-Vendor>${project.organization.name}</Bundle-Vendor> 
                    <Bundle-Version>${project.version}</Bundle-Version> 
                    <Bundle-Description>${project.description}</Bundle-Description>
                  </manifestEntries>
                </archive>
              </configuration>
            </plugin>

          </plugins>
       </build>
    </profile>

  </profiles>

</project>