<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>de.jaide</groupId>
  <artifactId>courier</artifactId>
  <version>1.6.2</version>
  <packaging>jar</packaging>

  <name>Courier</name>
  <url>https://github.com/JAIDE/courier</url>
  <description>Naive implementation of an e-mail sending framework. Send freemarker-templated HTML or text-only e-mails
    with just a few lines of code. Pre-configure sender accounts and overwrite them in your code where and if needed.
    Even e-mail headers are Freemarker-based.
  </description>

  <organization>
    <name>JAIDE GmbH</name>
    <url>http://www.jaide.de</url>
  </organization>

  <!-- Our license model -->
  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <!-- Developers working on this project -->
  <developers>
    <developer>
      <!-- The ID, as of now, represents the Github ID -->
      <id>riy</id>
      <name>Rias A. Sherzad</name>
      <email>rias.sherzad@jaide.de</email>
      <organization>JAIDE GmbH</organization>
      <organizationUrl>http://www.jaide.de</organizationUrl>
    </developer>
  </developers>

  <!-- As of now we're using Github as our SCM -->
  <scm>
    <connection>scm:git:git@github.com/JAIDE/gl-ewelding.git</connection>
    <developerConnection>scm:git:ssh://git@github.com/JAIDE/courier.git</developerConnection>
    <url>https://github.com/JAIDE/courier</url>
  </scm>

  <!-- Define where to deploy the artifact generated by this project to. -->
  <distributionManagement>
    <!--    <snapshotRepository>
          <id>snapshots</id>
          <name>JAIDE's Maven Repository: Snapshots</name>
          <url>http://repo.jaide.de/content/repositories/snapshots/</url>
        </snapshotRepository>
        <repository>
          <id>releases</id>
          <name>JAIDE's Maven Repository: Releases</name>
          <url>http://repo.jaide.de/content/repositories/releases/</url>
        </repository> -->
    <snapshotRepository>
      <id>sonatype-nexus-snapshots</id>
      <name>Sonatype's Maven Repository: Snapshots</name>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
    <repository>
      <id>sonatype-nexus-staging</id>
      <name>Sonatype's Maven Repository: Staging/Releases</name>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
    </repository>
  </distributionManagement>

  <!-- Variables -->
  <properties>
    <!-- Standard Maven build variables -->
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.build.resourceEncoding>UTF-8</project.build.resourceEncoding>
    <project.resources.sourceEncoding>UTF-8</project.resources.sourceEncoding>
    <maven.compile.encoding>UTF-8</maven.compile.encoding>

    <skipTests>true</skipTests>

    <!-- Dependency Versions -->
    <commons-email.version>1.3.1</commons-email.version>
    <commons-io.version>2.4</commons-io.version>
    <json-simple.version>1.1.1</json-simple.version>
    <freemarker.version>2.3.19</freemarker.version>
    <testng.version>6.8.1</testng.version>

    <!-- Reporting Plugin Versions -->
    <maven-site-plugin.version>3.2</maven-site-plugin.version>
    <maven-pmd-plugin.version>3.0.1</maven-pmd-plugin.version>
    <maven-checkstyle-plugin.version>2.10</maven-checkstyle-plugin.version>
    <cobertura-maven-plugin.version>2.5.2</cobertura-maven-plugin.version>

    <!-- Build Plugin Versions -->
    <maven-gpg-plugin.version>1.4</maven-gpg-plugin.version>
    <maven-idea-plugin.version>2.2</maven-idea-plugin.version>
    <maven-eclipse-plugin.version>2.9</maven-eclipse-plugin.version>
    <maven-java-formatter-plugin.version>0.3.1</maven-java-formatter-plugin.version>
    <maven-compiler-plugin.version>3.1</maven-compiler-plugin.version>
    <maven-jar-plugin.version>2.4</maven-jar-plugin.version>
    <maven-source-plugin.version>2.2.1</maven-source-plugin.version>
    <maven-javadoc-plugin.version>2.9.1</maven-javadoc-plugin.version>
    <maven-deploy-plugin.version>2.7</maven-deploy-plugin.version>
    <jrebel-maven-plugin.version>1.1.3</jrebel-maven-plugin.version>
    <maven-surefire-plugin.version>2.14.1</maven-surefire-plugin.version>
  </properties>

  <dependencies>
    <!-- Commons-Email -->
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-email</artifactId>
      <version>${commons-email.version}</version>
      <exclusions>
        <exclusion>
          <artifactId>activation</artifactId>
          <groupId>javax.activation</groupId>
        </exclusion>
      </exclusions>
    </dependency>

    <!-- Commons-IO -->
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <version>${commons-io.version}</version>
    </dependency>

    <!-- JSON-Simple -->
    <dependency>
      <groupId>com.googlecode.json-simple</groupId>
      <artifactId>json-simple</artifactId>
      <version>${json-simple.version}</version>
    </dependency>

    <!-- FreeMarker Template Engine -->
    <dependency>
      <groupId>org.freemarker</groupId>
      <artifactId>freemarker</artifactId>
      <version>${freemarker.version}</version>
    </dependency>

    <!-- TestNG -->
    <dependency>
      <groupId>org.testng</groupId>
      <artifactId>testng</artifactId>
      <version>${testng.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <reporting>
    <plugins>
      <!-- Site -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
        <version>${maven-site-plugin.version}</version>
      </plugin>

      <!-- PMD: Code Analysis -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-pmd-plugin</artifactId>
        <version>${maven-pmd-plugin.version}</version>
      </plugin>

      <!-- Checkstyle: Formatting Rules -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>${maven-checkstyle-plugin.version}</version>
        <configuration>
          <configLocation>src/team/checkstyle_jaide.xml</configLocation>
        </configuration>
      </plugin>

      <!-- Cobertura: Code Coverage -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>cobertura-maven-plugin</artifactId>
        <version>${cobertura-maven-plugin.version}</version>
        <configuration>
          <instrumentation>
            <includes>
              <include>de/jaide/courier/**/*.class</include>
            </includes>
          </instrumentation>
          <check>
            <branchRate>85</branchRate>
            <lineRate>85</lineRate>
            <haltOnFailure>true</haltOnFailure>
            <totalBranchRate>85</totalBranchRate>
            <totalLineRate>85</totalLineRate>
            <packageLineRate>85</packageLineRate>
            <packageBranchRate>85</packageBranchRate>
            <regexes>
              <regex>
                <pattern>de.jaide.courier.*</pattern>
                <branchRate>90</branchRate>
                <lineRate>80</lineRate>
              </regex>
            </regexes>
          </check>
        </configuration>
      </plugin>
    </plugins>
  </reporting>

  <build>
    <plugins>
      <!-- Configure the IntelliJ IDEA plugin to always download sources and Javadocs -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-idea-plugin</artifactId>
        <version>${maven-idea-plugin.version}</version>
        <configuration>
          <downloadSources>true</downloadSources>
          <downloadJavadocs>true</downloadJavadocs>
        </configuration>
      </plugin>

      <!-- Configure the Eclipse plugin to always download sources and Javadocs -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-eclipse-plugin</artifactId>
        <version>${maven-eclipse-plugin.version}</version>
        <configuration>
          <downloadSources>true</downloadSources>
          <downloadJavadocs>true</downloadJavadocs>
        </configuration>
      </plugin>

      <!-- Format the source code using Eclipse formatter rules -->
      <plugin>
        <groupId>com.googlecode.maven-java-formatter-plugin</groupId>
        <artifactId>maven-java-formatter-plugin</artifactId>
        <version>${maven-java-formatter-plugin.version}</version>
        <configuration>
          <configFile>src/team/formatter_jaide.xml</configFile>
          <overrideConfigCompilerVersion>true</overrideConfigCompilerVersion>
          <compilerSource>1.6</compilerSource>
          <compilerCompliance>1.6</compilerCompliance>
          <compilerTargetPlatform>1.6</compilerTargetPlatform>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>format</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <!-- Cobertura: Code Coverage -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>cobertura-maven-plugin</artifactId>
        <version>${cobertura-maven-plugin.version}</version>
        <executions>
          <execution>
            <id>clean</id>
            <phase>pre-site</phase>
            <goals>
              <goal>clean</goal>
            </goals>
          </execution>
          <execution>
            <id>instrument</id>
            <phase>site</phase>
            <goals>
              <goal>cobertura</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <!-- Compile against Java 6 -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>${maven-compiler-plugin.version}</version>
        <configuration>
          <encoding>${project.build.sourceEncoding}</encoding>
          <source>1.6</source>
          <target>1.6</target>
        </configuration>
      </plugin>

      <!-- Surefire Plugin -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${maven-surefire-plugin.version}</version>
        <configuration>
          <skipTests>${skipTests}</skipTests>
        </configuration>
      </plugin>

      <!-- Exclude the smtp.json configuration file from the packaged JAR -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>${maven-jar-plugin.version}</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <phase>deploy</phase>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <excludes>
            <exclude>**/smtp.json</exclude>
          </excludes>
        </configuration>
      </plugin>

      <!-- Exclude the smtp.json configuration file from the packaged source JAR -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>${maven-source-plugin.version}</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <excludes>
            <exclude>**/smtp.json</exclude>
          </excludes>
        </configuration>
      </plugin>

      <!-- Also deploy Javadocs into the repository -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>${maven-javadoc-plugin.version}</version>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <!-- Explicitly define maven-deploy-plugin after other to force exec order -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-deploy-plugin</artifactId>
        <version>${maven-deploy-plugin.version}</version>
        <executions>
          <execution>
            <id>deploy</id>
            <phase>deploy</phase>
            <goals>
              <goal>deploy</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <!-- This profile will be activated during the release:perform goal only, as SNAPSHOT versions don't need to be signed. -->
    <profile>
      <id>release-sign-artifacts</id>
      <activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>
      <build>
        <plugins>
          <!-- Sign our artifacts, so they can be uploaded to Maven Central -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>${maven-gpg-plugin.version}</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
