<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright (c) 2016, Viskan Distanshandel System AB

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<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>com.viskan</groupId>
    <artifactId>parent</artifactId>
    <version>4</version>
    <packaging>pom</packaging>
    <name>Viskan Distanshandel System AB</name>
    <description>Parent for all of Viskans Java projects.</description>
    <url>https://github.com/viskan/parent</url>

    <organization>
        <name>Viskan Distanshandel System AB</name>
        <url>http://viskan.com</url>
    </organization>

    <developers>
        <developer>
            <id>anton-johansson</id>
            <name>Anton Johansson</name>
            <email>antoon.johansson@gmail.com</email>
        </developer>
    </developers>

    <issueManagement>
        <url>https://github.com/viskan/parent/issues</url>
        <system>GitHub Issues</system>
    </issueManagement>

    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <scm>
        <url>https://github.com/viskan/parent</url>
        <connection>scm:git:git://github.com/viskan/parent.git</connection>
        <developerConnection>scm:git:git@github.com:viskan/parent.git</developerConnection>
        <tag>v4</tag>
    </scm>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <name>Maven Central Snapshot Repository</name>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <name>Maven Central Staging Repository</name>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
        </repository>
    </distributionManagement>

    <properties>
        <!-- Build -->
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <!-- OSGi -->
        <osgi.import.package>*</osgi.import.package>
        <osgi.export.package>{local-packages}</osgi.export.package>
        <osgi.dynamic.package />
        <osgi.activator.class />
    </properties>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <version>2.17</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>3.0.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>2.10.4</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.felix</groupId>
                    <artifactId>maven-bundle-plugin</artifactId>
                    <version>3.0.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>2.5.3</version>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <dependencies>
                    <dependency>
                        <groupId>com.viskan</groupId>
                        <artifactId>checkstyle-configuration</artifactId>
                        <version>4</version>
                    </dependency>
                    <dependency>
                        <groupId>com.puppycrawl.tools</groupId>
                        <artifactId>checkstyle</artifactId>
                        <version>6.19</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <id>checkstyle-main</id>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <configuration>
                            <sourceDirectories>
                                <sourceDirectory>src/main/java/</sourceDirectory>
                            </sourceDirectories>
                            <includeResources>true</includeResources>
                            <includeTestResources>false</includeTestResources>
                            <configLocation>viskan-checkstyle-main.xml</configLocation>
                            <violationSeverity>warning</violationSeverity>
                        </configuration>
                    </execution>
                    <execution>
                        <id>checkstyle-test</id>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <configuration>
                            <sourceDirectories>
                                <sourceDirectory>src/test/java/</sourceDirectory>
                            </sourceDirectories>
                            <includeResources>false</includeResources>
                            <includeTestResources>true</includeTestResources>
                            <configLocation>viskan-checkstyle-test.xml</configLocation>
                            <violationSeverity>warning</violationSeverity>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
                        <Implementation-Version>${project.version}</Implementation-Version>
                        <Import-Package>${osgi.import.package}</Import-Package>
                        <Export-Package>${osgi.export.package}</Export-Package>
                        <DynamicImport-Package>${osgi.dynamic.package}</DynamicImport-Package>
                        <Bundle-Activator>${osgi.activator.class}</Bundle-Activator>
                    </instructions>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <executions>
                    <execution>
                        <configuration>
                            <tagNameFormat>v@{project.version}</tagNameFormat>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>sonatype-oss-release</id>
            <build>
                <plugins>
                    <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>
