<!--

    Licensed to Apereo under one or more contributor license
    agreements. See the NOTICE file distributed with this work
    for additional information regarding copyright ownership.
    Apereo licenses this file to you 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 the following location:

      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/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>
    
    <parent>
        <groupId>org.sonatype.oss</groupId>
        <artifactId>oss-parent</artifactId>
        <version>9</version>
    </parent>
    
    <groupId>org.jasig.parent</groupId>
    <artifactId>jasig-parent</artifactId>
    <version>41</version>
    <packaging>pom</packaging>

    <name>Apereo Parent Project</name>
    <description>Defaults for Apereo Maven projects.</description>
    <url>https://github.com/Jasig/apereo-parent</url>

    <organization>
        <name>Apereo</name>
        <url>http://www.apereo.org</url>
    </organization>

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

    <scm>
        <connection>scm:git:git@github.com:Jasig/apereo-parent.git</connection>
        <developerConnection>scm:git:git@github.com:Jasig/apereo-parent.git</developerConnection>
        <url>https://github.com/Jasig/apereo-parent</url>
        <tag>jasig-parent-41</tag>
    </scm>

    <properties>
		
		<jasig-scm-base>https://raw.githubusercontent.com/Jasig/apereo-parent/master/</jasig-scm-base>

		<jasig-short-license-url>${jasig-scm-base}licenses/short-license-header.txt</jasig-short-license-url>
		<jasig-license-lookup-url>${jasig-scm-base}licenses/license-mappings.xml</jasig-license-lookup-url>
		<jasig-notice-template-url>${jasig-scm-base}licenses/NOTICE.template</jasig-notice-template-url>

		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.build.sourceVersion>1.7</project.build.sourceVersion>
		<project.build.targetVersion>1.7</project.build.targetVersion>
		<additionalReleaseArguments />

		<plexus.archiver.ver>3.0.1</plexus.archiver.ver>
		<wagon.webdav.jackrabbit.ver>2.9</wagon.webdav.jackrabbit.ver>

		<maven.ear.plugin.ver>2.10.1</maven.ear.plugin.ver>
		<maven.war.plugin.ver>2.6</maven.war.plugin.ver>
		<maven.compiler.plugin.ver>3.3</maven.compiler.plugin.ver>
		<maven.jar.plugin.ver>2.6</maven.jar.plugin.ver>
		<maven.release.plugin.ver>2.5.2</maven.release.plugin.ver>
		<maven.license.plugin.ver>2.11</maven.license.plugin.ver>
		<maven.legal.plugin.ver>1.0.2</maven.legal.plugin.ver>
		<maven.notice.plugin.ver>1.0.6.1</maven.notice.plugin.ver>
		<maven.site.plugin.ver>3.4</maven.site.plugin.ver>

        <!-- Reporting plug-ins.  See http://maven.apache.org/plugins/ with an R in the type column
             for report options and versions. -->
        <cobertura.maven.plugin.ver>2.7</cobertura.maven.plugin.ver>
        <findbugs.maven.plugin.ver>3.0.3</findbugs.maven.plugin.ver>
        <jdepend.maven.plugin.ver>2.0</jdepend.maven.plugin.ver>
        <maven.changelog.plugin.ver>2.3</maven.changelog.plugin.ver>
        <maven.javadoc.plugin.ver>2.10.3</maven.javadoc.plugin.ver>
        <maven.jxr.plugin.ver>2.5</maven.jxr.plugin.ver>
        <maven.pmd.plugin.ver>3.5</maven.pmd.plugin.ver>
        <maven.project.info.reports.plugin.ver>2.8.1</maven.project.info.reports.plugin.ver>
        <maven.surefire.report.plugin.ver>2.19</maven.surefire.report.plugin.ver>
        <taglist.maven.plugin.ver>2.4</taglist.maven.plugin.ver>

    </properties>
    
    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                	<groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven.compiler.plugin.ver}</version>
                    <configuration>
                        <source>${project.build.sourceVersion}</source>
                        <target>${project.build.targetVersion}</target>
                    </configuration>
                </plugin>
                <plugin>
                	<groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>${maven.jar.plugin.ver}</version>
                    <configuration>
                        <archive>
                            <manifest>
                                <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                            </manifest>
                        </archive>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>org.codehaus.plexus</groupId>
                            <artifactId>plexus-archiver</artifactId>
                            <version>${plexus.archiver.ver}</version>
                        </dependency>
                    </dependencies>
                </plugin>
                <plugin>
                	<groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-war-plugin</artifactId>
                    <version>${maven.war.plugin.ver}</version>
                    <configuration>
                        <attachClasses>true</attachClasses>
                        <archive>
                            <index>true</index>
                            <manifest>
                                <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                            </manifest>
                        </archive>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>org.codehaus.plexus</groupId>
                            <artifactId>plexus-archiver</artifactId>
                            <version>${plexus.archiver.ver}</version>
                        </dependency>
                    </dependencies>
                </plugin>
                <plugin>
                	<groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-ear-plugin</artifactId>
                    <version>${maven.ear.plugin.ver}</version>
                    <configuration>
                        <archive>
                            <index>true</index>
                            <manifest>
                                <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                            </manifest>
                        </archive>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>org.codehaus.plexus</groupId>
                            <artifactId>plexus-archiver</artifactId>
                            <version>${plexus.archiver.ver}</version>
                        </dependency>
                    </dependencies>
                </plugin>
                <plugin>
                	<groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>${maven.release.plugin.ver}</version>
                    <configuration>
                        <mavenExecutorId>forked-path</mavenExecutorId>
                        <useReleaseProfile>false</useReleaseProfile>
                        <arguments>${additionalReleaseArguments} -Psonatype-oss-release,jasig-release</arguments>
                    </configuration>
                </plugin>
                <plugin>
                	<groupId>com.mycila</groupId>
                	<artifactId>license-maven-plugin</artifactId>
                    <version>${maven.license.plugin.ver}</version>
                    <configuration>
                        <basedir>${basedir}</basedir>
                        <header>${jasig-short-license-url}</header>
                        <aggregate>true</aggregate>
                        <strictCheck>true</strictCheck>
                        <excludes>
                            <exclude>LICENSE</exclude>
                            <exclude>NOTICE</exclude>
                            <exclude>short-license-header.txt</exclude>  <!-- not present. Defaulted for other projects? -->
                        </excludes>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.jasig.maven</groupId>
                    <artifactId>maven-jasig-legal-plugin</artifactId>
                    <version>${maven.legal.plugin.ver}</version>
                </plugin>
                <plugin>
                    <groupId>org.jasig.maven</groupId>
                    <artifactId>maven-notice-plugin</artifactId>
                    <version>${maven.notice.plugin.ver}</version>
                    <configuration>
                        <noticeTemplate>${jasig-notice-template-url}</noticeTemplate>
                        <licenseMapping>
                            <param>${jasig-license-lookup-url}</param>
                        </licenseMapping>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.jasig.maven</groupId>
                <artifactId>maven-jasig-legal-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.jasig.maven</groupId>
                <artifactId>maven-notice-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <configuration>
                    <excludes>
                        <exclude>LICENSE</exclude>
                        <exclude>NOTICE</exclude>
                        <exclude>licenses/LICENSE.txt</exclude>
                        <exclude>licenses/NOTICE.template</exclude>
                        <exclude>licenses/short-license-header.txt</exclude>
                    </excludes>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jxr-plugin</artifactId>
                <version>${maven.jxr.plugin.ver}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>${maven.project.info.reports.plugin.ver}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-report-plugin</artifactId>
                <version>${maven.surefire.report.plugin.ver}</version>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>cobertura-maven-plugin</artifactId>
                <version>${cobertura.maven.plugin.ver}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-pmd-plugin</artifactId>
                <version>${maven.pmd.plugin.ver}</version>
                <configuration>
                    <linkXref>true</linkXref>
                    <sourceEncoding>utf-8</sourceEncoding>
                    <minimumTokens>100</minimumTokens>
                    <targetJdk>${project.build.sourceVersion}</targetJdk>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-changelog-plugin</artifactId>
                <version>${maven.changelog.plugin.ver}</version>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>taglist-maven-plugin</artifactId>
                <version>${taglist.maven.plugin.ver}</version>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>findbugs-maven-plugin</artifactId>
                <version>${findbugs.maven.plugin.ver}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${maven.javadoc.plugin.ver}</version>
                <configuration>
                    <source>${project.build.sourceVersion}</source>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>jdepend-maven-plugin</artifactId>
                <version>${jdepend.maven.plugin.ver}</version>
            </plugin>
        </plugins>
    </reporting>

    <profiles>
        <profile>
            <id>jasig-release</id>
            <build>
                <plugins>
                    <plugin>
                		<groupId>com.mycila</groupId>
                		<artifactId>license-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>check-license</id>
                                <phase>validate</phase>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
	                <plugin>
	                    <groupId>org.jasig.maven</groupId>
	                    <artifactId>maven-jasig-legal-plugin</artifactId>
	                    <executions>
	                        <execution>
	                            <id>copy-files</id>
                                <phase>validate</phase>
	                            <goals>
	                                <goal>copy-files</goal>
	                            </goals>
	                        </execution>
	                    </executions>
	                </plugin>
                    <plugin>
                        <groupId>org.jasig.maven</groupId>
                        <artifactId>maven-notice-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>check-notice</id>
                                <phase>validate</phase>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <!-- 
         | Maven site generation configuration had incompatible changes between 2 and 3. This profile only activates
         | for Maven 3 to activate standard site generation configuration.
         +-->
        <profile>
            <id>maven-3-site</id>
            <activation>
                <file>
                    <!-- This employs that the basedir expression is only recognized by Maven 3.x (see MNG-2363) -->
                    <exists>${basedir}</exists>
                </file>
            </activation>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-site-plugin</artifactId>
                            <version>${maven.site.plugin.ver}</version>
                            <dependencies>
                                <dependency>
                                    <groupId>org.apache.maven.wagon</groupId>
                                    <artifactId>wagon-webdav-jackrabbit</artifactId>
                                    <version>${wagon.webdav.jackrabbit.ver}</version>
                                </dependency>
                            </dependencies>
                        </plugin>
                    </plugins>
                </pluginManagement>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-site-plugin</artifactId>
                        <version>${maven.site.plugin.ver}</version>
                        <executions>
                            <execution>
                                <id>attach-descriptor</id>
                                <goals>
                                    <goal>attach-descriptor</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        
    </profiles>
</project>
