<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>

    <name>AgileDev</name>
    <groupId>org.uniknow</groupId>
    <artifactId>agiledev</artifactId>
    <version>0.1.8</version>
    <packaging>pom</packaging>
    <description>Tooling for Agile development</description>
    <url>https://github.com/UniKnow/AgileDev</url>

    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
            <comments>A business-friendly OSS license</comments>
        </license>
    </licenses>

    <organization>
        <name>UniKnow</name>
        <url>http://www.uniknow.org</url>
    </organization>

    <developers>
        <developer>
            <id>mase</id>
            <name>Mark Schenk</name>
            <organization>UniKnow</organization>
            <roles>
                <role>architect</role>
                <role>developer</role>
            </roles>
            <timezone>Europe/Amsterdam</timezone>
        </developer>
    </developers>

    <properties>
        <maven.compiler.source>1.7</maven.compiler.source>
        <maven.compiler.target>1.7</maven.compiler.target>

        <project.build.sourceEncoding>
            UTF-8
        </project.build.sourceEncoding>
        <project.reporting.outputEncoding>
            UTF-8
        </project.reporting.outputEncoding>

        <github.global.server>github</github.global.server>

        <!-- Version information dependencies -->
        <aspectj.version>[1.7.0,1.8.5]</aspectj.version>
        <cglib.version>3.1</cglib.version>
        <cucumber.version>1.1.5</cucumber.version>
        <doxia.version>1.5</doxia.version>
        <findbugs.jsr305.version>2.0.2</findbugs.jsr305.version>
        <groovy.version>2.1.6</groovy.version>
        <hibernate.version>[4.2.0.Final,4.3.2.Final]</hibernate.version>
        <javax.inject.version>1</javax.inject.version>
        <junit.version>4.11</junit.version>
        <mylyn.version>1.7.4.v20130429</mylyn.version>
        <oval.version>1.84</oval.version>
        <spring.framework.version>[3.0.7.RELEASE,3.2.13.RELEASE]
        </spring.framework.version>
    </properties>

    <distributionManagement>
        <site>
            <id>github-pages-site</id>
            <url>site/${project.version}</url>
        </site>

        <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>


    <scm>
        <connection>
            scm:git:git://github.com/uniKnow/AgileDev.git
        </connection>
        <developerConnection>
            scm:git:git@github.com:uniKnow/AgileDev.git
        </developerConnection>
        <url>https://github.com/UniKnow/AgileDev</url>
    </scm>

    <modules>
        <module>buildConfiguration</module>
        <module>maven-site-indexer</module>
        <module>common</module>
        <module>parent</module>
        <module>junitBdd</module>
        <module>dbc4java</module>
        <module>cucumber-reporting</module>
        <module>cucumber-reporting-example</module>
        <module>tutorials/dbc</module>
        <module>tutorials/ddd</module>
        <module>tutorials/rest</module>
    </modules>

    <dependencyManagement>
        <dependencies>
            <!--
            Dependencies for shared/root classes framework
            -->
            <dependency>
                <groupId>org.uniknow.agiledev</groupId>
                <artifactId>common</artifactId>
                <version>${project.version}</version>
            </dependency>

            <!-- Dependencies javax -->
            <dependency>
                <groupId>javax.inject</groupId>
                <artifactId>javax.inject</artifactId>
                <version>${javax.inject.version}</version>
            </dependency>

            <!-- Dependencies for enabling Design by Contract -->
            <dependency>
                <groupId>org.aspectj</groupId>
                <artifactId>aspectjrt</artifactId>
                <version>${aspectj.version}</version>
            </dependency>
            <dependency>
                <groupId>org.aspectj</groupId>
                <artifactId>aspectjweaver</artifactId>
                <version>${aspectj.version}</version>
                <scope>runtime</scope>
            </dependency>
            <dependency>
                <groupId>cglib</groupId>
                <artifactId>cglib</artifactId>
                <version>${cglib.version}</version>
            </dependency>


            <!-- Dependencies spring -->
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-beans</artifactId>
                <version>${spring.framework.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-aop</artifactId>
                <version>${spring.framework.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-test</artifactId>
                <version>${spring.framework.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-core</artifactId>
                <version>${spring.framework.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-context</artifactId>
                <version>${spring.framework.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-web</artifactId>
                <version>${spring.framework.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-aspects</artifactId>
                <version>${spring.framework.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-tx</artifactId>
                <version>${spring.framework.version}</version>
            </dependency>


            <!-- Dependency hibernate -->
            <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-validator</artifactId>
                <version>${hibernate.version}</version>
            </dependency>

            <!-- Dependency for findbug statically code analyzing -->
            <dependency>
                <groupId>com.google.code.findbugs</groupId>
                <artifactId>jsr305</artifactId>
                <version>${findbugs.jsr305.version}</version>
            </dependency>

            <!-- Dependencies testing -->
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${junit.version}</version>
                <scope>test</scope>
            </dependency>

        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <!--
                Maven Java compiler plugin
                -->
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.1</version>
                    <configuration>
                        <source>${maven.compiler.source}</source>
                        <target>${maven.compiler.target}</target>
                    </configuration>
                </plugin>

                <!--
                   Plugin for managing the license of project
                -->
                <plugin>
                    <groupId>com.mycila.maven-license-plugin</groupId>
                    <artifactId>maven-license-plugin</artifactId>
                    <version>1.9.0</version>
                    <configuration>
                        <strictCheck>true</strictCheck>
                        <header>license/header.txt</header>
                        <properties>
                            <organizationName>uniknow</organizationName>
                            <inceptionYear>2014</inceptionYear>
                        </properties>

                        <excludes>
                            <exclude>**/*.iml</exclude>
                            <exclude>target/**</exclude>
                            <exclude>.idea/**</exclude>
                        </excludes>

                    </configuration>
                    <executions>
                        <execution>
                            <goals>
                                <goal>format</goal>
                            </goals>
                            <phase>process-sources</phase>
                        </execution>
                    </executions>
                    <dependencies>
                        <dependency>
                            <groupId>org.uniknow.agiledev</groupId>
                            <artifactId>buildConfiguration</artifactId>
                            <version>0.1.8</version>
                        </dependency>
                    </dependencies>
                </plugin>

                <!--
                    Plugin for formatting java source files following specified
                    code conventions. The formatter is based on the eclipse
                    formatted and can use the exported xml formatting definitions
                -->
                <plugin>
                    <groupId>com.googlecode.maven-java-formatter-plugin
                    </groupId>
                    <artifactId>maven-java-formatter-plugin</artifactId>
                    <version>0.4</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>format</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <lineEnding>LF</lineEnding>
                        <configFile>formatter/uniknow.xml</configFile>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>org.uniknow.agiledev</groupId>
                            <artifactId>buildConfiguration</artifactId>
                            <version>0.1.8</version>
                        </dependency>
                    </dependencies>
                </plugin>

                <!-- Plugin to generate javadocs -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>2.9.1</version>
                    <configuration>
                        <!--
                        A Doclet that allows the use of Markdown and
                        PlantUML in JavaDoc comments.
                        -->
                        <doclet>ch.raffael.doclets.pegdown.PegdownDoclet
                        </doclet>
                        <docletArtifact>
                            <groupId>ch.raffael.pegdown-doclet</groupId>
                            <artifactId>pegdown-doclet</artifactId>
                            <version>1.1</version>
                        </docletArtifact>
                        <useStandardDocletOptions>
                            true
                        </useStandardDocletOptions>
                    </configuration>
                </plugin>

                <!-- Instrument classes for code coverage reporting -->
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>cobertura-maven-plugin</artifactId>
                    <version>2.6</version>
                    <configuration>
                        <aggregate>false</aggregate>
                        <attach>false</attach>
                        <check>
                        </check>
                        <instrumentation>
                            <ignores>
                                <ignore>org.agileDev.*</ignore>
                            </ignores>
                            <excludes>
                                <exlude>org/agileDev/**/*.class</exlude>
                            </excludes>
                        </instrumentation>
                        <formats>
                            <format>html</format>
                            <format>xml</format>
                        </formats>
                    </configuration>
                    <executions>
                        <!--<execution>-->
                        <!--<id>clean</id>-->
                        <!--<phase>pre-site</phase>-->
                        <!--<goals>-->
                        <!--<goal>clean</goal>-->
                        <!--</goals>-->
                        <!--</execution>-->
                        <execution>
                            <id>instrument-code-coverage</id>
                            <phase>site</phase>
                            <goals>
                                <!--<goal>instrument</goal>-->
                                <goal>cobertura</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>1.3.1</version>
                <configuration>
                    <skip>false</skip>
                    <fail>true</fail>
                    <rules>
                        <requireUpperBoundDeps />
                        <!-- ensure uniquely versioned dependencies during the build -->
                        <dependencyConvergence />
                    </rules>
                </configuration>
                <executions>
                    <execution>
                        <id>enforce-dependencies</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <artifactId>maven-site-plugin</artifactId>
                <version>3.3</version>
                <dependencies>
                    <!--
                    allows confluence syntax for site documentation. To use it
                    place files below src/site/confluence/[filename].confluence
                    -->
                    <dependency>
                        <groupId>org.apache.maven.doxia</groupId>
                        <artifactId>doxia-module-confluence</artifactId>
                        <version>${doxia.version}</version>
                    </dependency>

                    <!--
                    allows markdown syntax for site documentation. To use it
                    place files below src/site/markdown/[filename].md
                    -->
                    <dependency>
                        <groupId>org.apache.maven.doxia</groupId>
                        <artifactId>doxia-module-markdown</artifactId>
                        <version>${doxia.version}</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <!--
                    Disable deployment of the maven site; this will be done by
                    the github site plugin
                    -->
                    <skipDeploy>true</skipDeploy>

                </configuration>
            </plugin>

            <!--
            Plugin to create PDF
            -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-pdf-plugin</artifactId>
                <version>1.3</version>
                <executions>
                    <execution>
                        <id>pdf</id>
                        <phase>site</phase>
                        <goals>
                            <goal>pdf</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>
                                ${project.reporting.outputDirectory}
                            </outputDirectory>
                            <includeReports>false</includeReports>
                        </configuration>
                    </execution>
                </executions>
                <dependencies>
                    <!--
                    allows confluence syntax for site documentation. To use it
                    place files below src/site/confluence/[filename].confluence
                    -->
                    <dependency>
                        <groupId>org.apache.maven.doxia</groupId>
                        <artifactId>doxia-module-confluence</artifactId>
                        <version>${doxia.version}</version>
                    </dependency>

                    <!--
                    allows markdown syntax for site documentation. To use it
                    place files below src/site/markdown/[filename].md
                    -->
                    <dependency>
                        <groupId>org.apache.maven.doxia</groupId>
                        <artifactId>doxia-module-markdown</artifactId>
                        <version>${doxia.version}</version>
                    </dependency>
                </dependencies>
            </plugin>

            <!--
            Note: ensure the proper GitHub authentication settings are included
            in your settings.xml
            -->
            <plugin>
                <groupId>com.github.github</groupId>
                <artifactId>site-maven-plugin</artifactId>
                <version>0.11</version>
                <configuration>
                    <message>
                        Creating site for ${project.artifactId},
                        ${project.version}
                    </message>
                    <path>${project.distributionManagement.site.url}</path>
                    <merge>true</merge>
                </configuration>
                <executions>
                    <execution>
                        <id>github-site</id>
                        <goals>
                            <goal>site</goal>
                        </goals>
                        <phase>site</phase>
                    </execution>
                </executions>
            </plugin>

            <!-- ================================================== -->
            <!-- GitFlow plugin								        -->
            <!-- support for GitFlow style releases via maven		-->
            <!-- ================================================== -->
            <plugin>
                <groupId>external.atlassian.jgitflow</groupId>
                <artifactId>jgitflow-maven-plugin</artifactId>
                <version>1.0-m4.3</version>
                <configuration>
                    <!-- Append feature name to version of feature branch -->
                    <enableFeatureVersions>true</enableFeatureVersions>

                    <!-- Enable SSH agent to push to origin using SSH keys -->
                    <enableSshAgent>true</enableSshAgent>

                    <!-- Keep your maven submodules at the same version as the parent POM  -->
                    <autoVersionSubmodules>true</autoVersionSubmodules>

                    <!--
                        Pushing in-development features to origin allows all developers to
                        see what each other are working on
                    -->
                    <pushFeatures>true</pushFeatures>

                    <!--
                        This allows the CI server (e.g. Jenkins) to automatically push new
                        releases to origin; you can then either manually deploy them or, if you
                        are doing Continuous Deployments, auto-deploy them to prod
                    -->
                    <pushReleases>true</pushReleases>

                    <!--
                        Hot Fixes should be pushed to origin as well so that any dev can
                        pick them up
                    -->
                    <pushHotfixes>true</pushHotfixes>

                    <!--
                        Prevents deployments from dev workstations so that they can be done
                        by a CI server
                    -->
                    <noDeploy>false</noDeploy>

                    <!--
                        If set to true, the plugin sets the property "performRelease" to true, which activates the profile "release-profile"
                     -->
                    <useReleaseProfile>true</useReleaseProfile>

                    <!--
                        GitFlow init context
                    -->
                    <flowInitContext>
                        <masterBranchName>master</masterBranchName>
                        <developBranchName>develop</developBranchName>
                        <featureBranchPrefix>feature-</featureBranchPrefix>
                        <releaseBranchPrefix>release-</releaseBranchPrefix>
                        <hotfixBranchPrefix>hotfix-</hotfixBranchPrefix>
                        <versionTagPrefix>${project.artifactId}-
                        </versionTagPrefix>
                    </flowInitContext>
                </configuration>
            </plugin>

            <!-- Plugins for releasing artifacts to maven central repository -->
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.5</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>
            <!--<plugin>-->
            <!--<groupId>org.apache.maven.plugins</groupId>-->
            <!--<artifactId>maven-release-plugin</artifactId>-->
            <!--&lt;!&ndash;<version>2.7</version>&ndash;&gt;-->
            <!--<configuration>-->
            <!--<autoVersionSubmodules>true</autoVersionSubmodules>-->
            <!--<useReleaseProfile>false</useReleaseProfile>-->
            <!--<releaseProfiles>release-signed-artifacts</releaseProfiles>-->
            <!--<goals>deploy</goals>-->
            <!--</configuration>-->
            <!--</plugin>-->

        </plugins>
    </build>

    <profiles>
        <profile>
            <id>release-profile</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>