<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>fi.metatavu.mecm.reader</groupId>
  <artifactId>mecm-reader</artifactId>
  <version>0.0.10</version>
  <packaging>jar</packaging>
  <name>MECM Reader</name>
  <description>Readerer for MECM data</description>
  <url>https://github.com/Metatavu/mecm-reader</url>

  <licenses>
    <license>
      <name>GNU Affero General Public License v3</name>
      <url>http://www.gnu.org/licenses/agpl-3.0.html</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  
  <developers>
    <developer>
      <id>metatavu</id>
      <email>devs@metatavu.fi</email>
      <name>Metatavu Oy</name>
      <organization>Metatavu Oy</organization>
      <organizationUrl>https://www.metatavu.fi/</organizationUrl>
      <roles>
        <role>Owner</role>
      </roles>
    </developer>
  </developers>

  <issueManagement>
    <system>GitHub</system>
    <url>https://github.com/Metatavu/mecm-reader/issues</url>
  </issueManagement>

  <scm>
    <developerConnection>scm:git:git@github.com:Metatavu/mecm-reader.git</developerConnection>
    <url>git@github.com:Metatavu/mecm-reader.git</url>
    <connection>scm:git:git@github.com:Metatavu/mecm-reader.git</connection>
    <tag>0.0.10</tag>
  </scm>

  <organization>
    <name>Metatavu Oy</name>
    <url>https://www.metatavu.fi</url>
  </organization>

  <properties>
    <!-- Project -->

    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

    <!-- Maven -->

    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>

    <!-- Commons -->
    
    <commons-lang3.version>3.5</commons-lang3.version>    
    <commons-cli.version>1.3.1</commons-cli.version>
    <commons-io.version>2.6</commons-io.version>

    <!-- Jackson -->
    
    <jackson-dataformat-xml.version>2.8.5</jackson-dataformat-xml.version>
    <jackson-datatype-jsr310.version>2.8.5</jackson-datatype-jsr310.version>
    
    <!-- VCard -->
    
    <ez-vcard.version>0.10.0</ez-vcard.version>
    
    <!-- Tests -->
    
    <junit.version>4.12</junit.version>
    <jacoco.reportPath>${project.basedir}/target/jacoco.exec</jacoco.reportPath>
    <skipCoverage>true</skipCoverage>
    
  </properties>

  <dependencies>

    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
      <version>${commons-lang3.version}</version>
    </dependency>
  
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <version>${commons-io.version}</version>
    </dependency>

    <dependency>
      <groupId>com.fasterxml.jackson.dataformat</groupId>
      <artifactId>jackson-dataformat-xml</artifactId>
      <version>${jackson-dataformat-xml.version}</version>
    </dependency>
    
    <dependency>
      <groupId>com.fasterxml.jackson.datatype</groupId>
      <artifactId>jackson-datatype-jsr310</artifactId>
      <version>${jackson-datatype-jsr310.version}</version>
    </dependency>

    <dependency>
      <groupId>com.googlecode.ez-vcard</groupId>
      <artifactId>ez-vcard</artifactId>
      <version>${ez-vcard.version}</version>
    </dependency>
    
    <dependency>
      <groupId>commons-cli</groupId>
      <artifactId>commons-cli</artifactId>
      <version>${commons-cli.version}</version>
    </dependency>
    
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>
  
  </dependencies>
    
  <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>
            <phase>verify</phase>
            <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.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>0.7.8</version>
        <executions>
          <execution>
            <id>prepare-agent</id>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
          <execution>
            <id>report</id>
            <goals>
              <goal>report</goal>
            </goals>
            <phase>test</phase>
          </execution>
        </executions>
      </plugin>
                
      <plugin>
        <groupId>org.eluder.coveralls</groupId>
        <artifactId>coveralls-maven-plugin</artifactId>
        <version>4.3.0</version>
        <executions>
          <execution>
            <id>coveralls-report</id>
            <phase>test</phase>
            <goals>
              <goal>report</goal>
            </goals>
            <configuration>
              <skip>${skipCoverage}</skip>
            </configuration>
          </execution>
        </executions>
      </plugin>
      
    </plugins>
  </build>
  
  
  <profiles>
    <profile>  
      <id>sonatype-oss-release</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <version>3.0.0</version>
            <executions>
              <execution>
                <phase>package</phase>
                <goals>
                  <goal>single</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <archive>
                <manifest>
                  <mainClass>fi.metatavu.mecm.reader.Main</mainClass>
                </manifest>
              </archive>
              <descriptorRefs>
                <descriptorRef>jar-with-dependencies</descriptorRef>
              </descriptorRefs>
            </configuration>
          </plugin>
        
          <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>
              <tagNameFormat>@{project.version}</tagNameFormat>
              <autoVersionSubmodules>true</autoVersionSubmodules>
              <arguments>-Dgpg.passphrase=${env.PGP_PASSPHRASE} -Psonatype-oss-release</arguments>
            </configuration>
          </plugin>
          
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>1.6.7</version>
            <extensions>true</extensions>
            <configuration>
              <serverId>sonatype-nexus-staging</serverId>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
              <autoReleaseAfterClose>true</autoReleaseAfterClose>
            </configuration>
          </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>
  
  <distributionManagement>
    <snapshotRepository>
      <id>sonatype-nexus-snapshots</id>
      <name>Sonatype Nexus Snapshots</name>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
    <repository>
      <id>sonatype-nexus-staging</id>
      <name>Nexus Release Repository</name>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
  </distributionManagement>
    
</project>