<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://maven.apache.org/POM/4.0.0"
         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.github.mikkoi.maven.enforcer.rule</groupId>
    <artifactId>char-set-encoding-rule</artifactId>
    <version>1.0</version>
    <packaging>jar</packaging>
    <name>Maven Enforcer Char Set Encoding</name>
    <description>Maven Enforcer plugin: Force the character set of all or any file in the project.</description>
    <url>https://github.com/mikkoi/maven-enforcer-char-set-encoding</url>
    <inceptionYear>2016</inceptionYear>

    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
            <comments>A business-friendly OSS license</comments>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:git://github.com/mikkoi/maven-enforcer-char-set-encoding.git</connection>
        <developerConnection>scm:git:ssh://github.com:mikkoi/maven-enforcer-char-set-encoding.git</developerConnection>
        <url>https://github.com/mikkoi/maven-enforcer-char-set-encoding</url>
    </scm>

    <developers>
        <developer>
            <id>mikkoi</id>
            <name>Mikko Koivunalho</name>
            <email>mikko DOT koivunalho CATTAIL iki DOT fi</email>
            <url>http://www.about.me/mikkokoivunalho</url>
            <organization>Private</organization>
            <organizationUrl>http://www.linkedin.com/in/mikkokoivunalho/</organizationUrl>
            <roles>
                <role>requirements analyst</role>
                <role>architect</role>
                <role>developer</role>
            </roles>
            <timezone>Europe/Stockholm</timezone>
            <properties>
                <gitHubUrl>https://github.com/mikkoi</gitHubUrl>
            </properties>
        </developer>
    </developers>

    <properties>
        <enforcer.api.version>1.4.1</enforcer.api.version>
        <maven.version>2.0.9</maven.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <java.version>1.7</java.version>
        <maven.compiler.source>${java.version}</maven.compiler.source>
        <maven.compiler.target>${java.version}</maven.compiler.target>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.apache.maven.enforcer</groupId>
            <artifactId>enforcer-api</artifactId>
            <version>${enforcer.api.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.enforcer</groupId>
            <artifactId>enforcer-rules</artifactId>
            <version>${enforcer.api.version}</version>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.enforcer</groupId>
            <artifactId>enforcer-rules</artifactId>
            <version>${enforcer.api.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-project</artifactId>
            <version>${maven.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-core</artifactId>
            <version>${maven.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-artifact</artifactId>
            <version>${maven.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-plugin-api</artifactId>
            <version>${maven.version}</version>
        </dependency>
        <dependency>
            <groupId>com.googlecode.juniversalchardet</groupId>
            <artifactId>juniversalchardet</artifactId>
            <version>1.0.3</version>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>19.0</version>
        </dependency>
        <dependency>
            <groupId>com.ibm.icu</groupId>
            <artifactId>icu4j</artifactId>
            <version>57.1</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>

        <!-- QA -->
        <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>jsr305</artifactId>
            <version>3.0.1</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>findbugs-annotations</artifactId>
            <version>3.0.1</version>
            <scope>provided</scope>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.5.1</version>
                <configuration>
                    <source>${maven.compiler.source}</source>
                    <target>${maven.compiler.target}</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>1.4.1</version>
                <executions>
                    <execution>
                        <id>enforce-our-project</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireMavenVersion>
                                    <version>3</version>
                                </requireMavenVersion>
                                <requireJavaVersion>
                                    <level>ERROR</level>
                                    <version>${java.version}</version>
                                </requireJavaVersion>
                            </rules>
                        </configuration>
                    </execution>
                    <execution>
                        <id>enforce-properties</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireProperty>
                                    <property>project.basedir</property>
                                    <message>Property 'project.basedir' is mandatory!</message>
                                    <regex>.+</regex>
                                    <regexMessage>Property 'project.basedir' must contain at least one character.
                                    </regexMessage>
                                </requireProperty>
                                <requireProperty>
                                    <property>project.build.sourceEncoding</property>
                                    <message>Property 'project.build.sourceEncoding' is mandatory!</message>
                                    <regex>UTF-8</regex>
                                    <regexMessage>The 'project.build.sourceEncoding' property must be UTF-8.
                                    </regexMessage>
                                </requireProperty>
                                <requireProperty>
                                    <property>project.version</property>
                                    <message>"Project version must be specified."</message>
                                    <regex>.*(\d|-SNAPSHOT)$</regex>
                                    <regexMessage>"Project version must end in a number or -SNAPSHOT."</regexMessage>
                                </requireProperty>
                            </rules>
                            <fail>true</fail>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>findbugs-maven-plugin</artifactId>
                <version>3.0.3</version>
                <configuration>
                    <!--
                        Enables analysis which takes more memory but finds more bugs.
                        If you run out of memory, changes the value of the effort element
                        to 'Low'.
                    -->
                    <effort>Max</effort>
                    <!-- Reports all bugs (other values are medium and max) -->
                    <threshold>Low</threshold>
                    <!-- Produces XML report -->
                    <xmlOutput>true</xmlOutput>
                    <!-- Configures the directory in which the XML report is created -->
                    <findbugsXmlOutputDirectory>${project.build.directory}/findbugs</findbugsXmlOutputDirectory>
                    <excludeFilterFile>${project.basedir}/findbugs-exclude.xml</excludeFilterFile>
                </configuration>
                <executions>
                    <!-- Ensures that FindBugs inspects source code when project is compiled. -->
                    <execution>
                        <id>analyze-compile</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <!--Another source code analyzer. https://pmd.github.io/-->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-pmd-plugin</artifactId>
                <version>3.6</version>
                <configuration>
                    <linkXRef>false</linkXRef>
                    <sourceEncoding>utf-8</sourceEncoding>
                    <minimumTokens>100</minimumTokens>
                    <targetJdk>${maven.compiler.source}</targetJdk>
                    <excludes>
                    </excludes>
                    <excludeRoots>
                    </excludeRoots>
                </configuration>
                <executions>
                    <execution>
                        <id>analyze-compile</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>check</goal>
                            <goal>cpd-check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <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>

        </plugins>

    </build>

    <profiles>
        <profile>
            <id>release</id>
            <!--<properties>-->
                <!--<gpg.keyname>********</gpg.keyname>-->
                <!--<gpg.passphrase>*********</gpg.passphrase>-->
            <!--</properties>-->
            <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>
                                <configuration>
                                    <keyname>${gpg.keyname}</keyname>
                                    <!--<passphraseServerId>${gpg.passphrase}</passphraseServerId>-->
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <!--<plugin>-->
                        <!--<groupId>org.apache.maven.plugins</groupId>-->
                        <!--<artifactId>maven-jarsigner-plugin</artifactId>-->
                        <!--<version>1.4</version>-->
                        <!--<executions>-->
                            <!--<execution>-->
                                <!--<id>sign</id>-->
                                <!--<goals>-->
                                    <!--<goal>sign</goal>-->
                                <!--</goals>-->
                            <!--</execution>-->
                        <!--</executions>-->
                        <!--<configuration>-->
                            <!--<verbose>true</verbose>-->
                            <!--<keystore>/home/mikkoi/tmp/temp-keys/.gnupg-master</keystore>-->
                            <!--<alias>Alias name</alias>-->
                            <!--<storepass>Store password</storepass>-->
                            <!--<keypass>Key password</keypass>-->
                        <!--</configuration>-->
                    <!--</plugin>-->
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.7</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>

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

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

</project>
