<?xml version="1.0"?>
<!-- Copyright 2010 Västra Götalandsregionen This library is free software; you can redistribute it and/or modify it 
  under the terms of version 2.1 of the GNU Lesser General Public License as published by the Free Software Foundation. 
  This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty 
  of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 
  You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the 
  Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -->

<!-- This is the System-level Maven POM. Usage: Define all truly common things for the system here. For example: versions 
  of third-party dependencies used throughout the system. Template version: 1.2-SNAPSHOT Generation time : 2009-12-18 
  13:18:09 CET -->
<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/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <groupId>se.vgregion.common</groupId>
    <artifactId>profile</artifactId>
    <packaging>pom</packaging>
    <version>2.16</version>
    <name>${project.artifactId}</name>
    <description>Corporate POM for projects in the oppna-program community.</description>
    <url>http://vastra-gotalandsregionen.github.io/oppna-program/</url>

    <licenses>
        <license>
            <name>GNU Lesser General Public License</name>
            <url>http://www.gnu.org/licenses/lgpl.txt</url>
            <distribution>repo</distribution>
            <comments>The LGPL places copyleft restrictions on the program itself but does not apply these restrictions
                to other software that merely links with the program.
            </comments>
        </license>
    </licenses>
    <developers>
        <developer>
            <id>hangy2</id>
            <name>Hans Gyllensten</name>
            <organization>Västra Götalandsregionen</organization>
            <organizationUrl>http://www.vgregion.se</organizationUrl>
            <roles>
                <role>lead architect</role>
            </roles>
            <timezone>+1</timezone>
        </developer>
        <developer>
            <id>aasplund</id>
            <name>Anders Asplund</name>
            <organization>Callista Enterprise</organization>
            <organizationUrl>http://callistaenterprise.se</organizationUrl>
            <roles>
                <role>architect</role>
                <role>developer</role>
            </roles>
            <timezone>+1</timezone>
        </developer>
        <developer>
            <id>asse.hemma</id>
            <name>Anders Bergkvist</name>
            <organization>Omegapoint</organization>
            <organizationUrl>http://www.omegapoint.se</organizationUrl>
            <roles>
                <role>architect</role>
                <role>developer</role>
            </roles>
            <timezone>+1</timezone>
        </developer>
        <developer>
            <id>wmdaros</id>
            <name>David Rosell</name>
            <organization>Redpill-Linpro</organization>
            <organizationUrl>http://www.redpill-linpro.com</organizationUrl>
            <roles>
                <role>architect</role>
                <role>developer</role>
            </roles>
            <timezone>+1</timezone>
        </developer>
        <developer>
            <id>jonas.liljenfeldt</id>
            <name>Jonas Liljenfeldt</name>
            <organization>Know IT</organization>
            <organizationUrl>http://www.knowit.se</organizationUrl>
            <roles>
                <role>architect</role>
                <role>developer</role>
            </roles>
            <timezone>+1</timezone>
        </developer>
        <developer>
            <id>patbe5</id>
            <name>Patrik Björk</name>
            <organization>Codespirit</organization>
            <roles>
                <role>architect</role>
                <role>developer</role>
            </roles>
            <timezone>+1</timezone>
        </developer>
    </developers>

    <modules>
        <module>internal</module>
        <module>open</module>
    </modules>

    <!-- common library versions -->
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <servlet-api.version>3.0.1</servlet-api.version>
        <slf4j.version>1.7.35</slf4j.version>
        <log4j.version>2.17.1</log4j.version>
        <junit.version>4.8.1</junit.version>
        <compileSource>1.8</compileSource>
        <compileTarget>1.8</compileTarget>
    </properties>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>2.5.3</version>
                </plugin>

                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <configuration>
                        <excludes>
                            <exclude>**/integrationtest/**</exclude>
                        </excludes>
                    </configuration>
                </plugin>

            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <artifactId>maven-war-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifestEntries>
                            <Version>${project.version}</Version>
                        </manifestEntries>
                    </archive>
                </configuration>
                <version>2.6</version>
            </plugin>
            <plugin>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifestEntries>
                            <Version>${project.version}</Version>
                        </manifestEntries>
                    </archive>
                </configuration>
                <version>2.5</version>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>${compileSource}</source>
                    <target>${compileTarget}</target>
                    <optimize>false</optimize>
                    <debug>true</debug>
                </configuration>
                <version>3.5.1</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                        <configuration>
                            <testFailureIgnore>true</testFailureIgnore>
                        </configuration>
                    </execution>
                </executions>
                <version>2.22.1</version>
            </plugin>
            <plugin>
                <artifactId>maven-scm-plugin</artifactId>
                <configuration>
                    <connectionType>developerConnection</connectionType>
                </configuration>
                <version>1.3</version>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <configuration>
                    <configLocation>
                        https://raw.githubusercontent.com/Vastra-Gotalandsregionen/oppna-program/gh-pages/dev-environment/checkstyle/sun_checks_vgr.xml
                    </configLocation>
                    <consoleOutput>true</consoleOutput>
                    <detail>true</detail>
                </configuration>
                <version>2.10</version>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>cobertura-maven-plugin</artifactId>
                <configuration>
                    <check>true</check>
                    <formats>
                        <format>html</format>
                        <format>xml</format>
                    </formats>
                    <instrumentation>
                        <includes>
                            <include>se/vgregion/**/*.class</include>
                        </includes>
                    </instrumentation>
                </configuration>
                <version>2.7</version>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-pmd-plugin</artifactId>
                <configuration>
                    <targetJdk>${compileTarget}</targetJdk>
                </configuration>
                <version>3.6</version>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>findbugs-maven-plugin</artifactId>
                <configuration>
                    <findbugsXmlOutput>true</findbugsXmlOutput>
                    <onlyAnalyze>se.vgregion.*</onlyAnalyze>
                    <xmlOutput>true</xmlOutput>
                </configuration>
                <version>2.3.2</version>
            </plugin>

        </plugins>

    </build>

    <scm>
        <developerConnection>scm:git:git@git.vgregion.se:portal-teamet/corporate-pom-archive.git</developerConnection>
        <url>https://git.vgregion.se/portal-teamet/corporate-pom-archive</url>
        <tag>profile-2.16</tag>
    </scm>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jxr-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
            </plugin>
        </plugins>
    </reporting>

    <distributionManagement>
        <snapshotRepository>
            <id>sonatype-nexus</id>
            <name>Sonatype Nexus Snapshots</name>
            <url>http://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>sonatype-nexus</id>
            <name>Sonatype Nexus Releases</name>
            <url>http://oss.sonatype.org/service/local/staging/deploy/maven2</url>
        </repository>
    </distributionManagement>

    <dependencyManagement>

    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-api</artifactId>
            <version>${log4j.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
            <version>${log4j.version}</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${slf4j.version}</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>${slf4j.version}</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <profiles>

        <profile>
            <id>default</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-war-plugin</artifactId>
                        <configuration>
                            <packagingExcludes>**/security.properties</packagingExcludes>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <!-- The prod-profile is used when building production artifacts with securities (security.properties) included.
              NB! Never deploy to maven repo with this profile. -->
            <id>prod</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <configuration>
                            <optimize>true</optimize>
                            <debug>false</debug>
                        </configuration>
                    </plugin>

                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>buildnumber-maven-plugin</artifactId>
                        <version>1.4</version>
                        <executions>
                            <execution>
                                <phase>validate</phase>
                                <goals>
                                    <goal>create</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <buildNumberPropertyName>buildNumber</buildNumberPropertyName>
                            <timestampFormat>{0, time, yyyy-MM-dd HH:mm:ss z}</timestampFormat>
                            <timestampPropertyName>build.time</timestampPropertyName>
                            <doCheck>true</doCheck>
                            <doUpdate>false</doUpdate>
                            <shortRevisionLength>7</shortRevisionLength>
                            <scmBranchPropertyName>build.branch</scmBranchPropertyName>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-war-plugin</artifactId>
                        <version>3.0.0</version>
                        <configuration>
                            <archive>
                                <manifest>
                                    <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                                    <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                                </manifest>
                                <manifestEntries>
                                    <Build-Number>${buildNumber}</Build-Number>
                                    <Build-Time>${build.time}</Build-Time>
                                    <Branch>${build.branch}</Branch>
                                </manifestEntries>
                            </archive>
                        </configuration>
                    </plugin>

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

        <profile>
            <!-- The tets-profile is used when building test artifacts with securities (security.properties) included. NB!
              Never deploy to maven repo with this profile. -->
            <id>test</id>
            <build>
                <plugins>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>release-sign-artifacts</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-war-plugin</artifactId>
                        <configuration>
                            <packagingExcludes>**/security.properties</packagingExcludes>
                        </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>
                    <plugin>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <configuration>
                            <source>${compileSource}</source>
                            <target>${compileTarget}</target>
                            <optimize>true</optimize>
                            <debug>false</debug>
                        </configuration>
                    </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>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
