<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2017 Alexander Perucci

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.alexanderperucci</groupId>
   <artifactId>spring-grow</artifactId>
   <version>1.0.1</version>
   <packaging>jar</packaging>

   <name>spring-grow</name>
   <description>Maven Archetype which can generate a secured Spring MVC Web Application (XML Configuration)</description>
   <url>https://github.com/alexander-perucci/spring-grow</url>
   
   <properties>
      <maven.compiler.source>1.8</maven.compiler.source>
      <maven.compiler.target>1.8</maven.compiler.target>
      <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
      <!-- plugins -->
      <maven-javadoc-plugin.version>2.10.4</maven-javadoc-plugin.version>
      <maven-source-plugin.version>3.0.1</maven-source-plugin.version>
      <license-maven-plugin.version>3.0</license-maven-plugin.version>
      <apache-rat-plugin.version>0.12</apache-rat-plugin.version>
      <maven-invoker-plugin.version>2.0.0</maven-invoker-plugin.version>
      <maven-release-plugin.version>2.5.3</maven-release-plugin.version>
      <maven-deploy-plugin.version>2.8.2</maven-deploy-plugin.version>
      <maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
   </properties>

   <licenses>
      <license>
         <name>The Apache Software License, Version 2.0</name>
         <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
         <distribution>repo</distribution>
      </license>
   </licenses>

   <scm>
      <connection>scm:git:git@github.com:alexander-perucci/spring-grow.git</connection>
      <developerConnection>scm:git:git@github.com:alexander-perucci/spring-grow.git</developerConnection>
      <url>git@github.com:alexander-perucci/spring-grow.git</url>
      <tag>spring-grow-1.0.1</tag>
   </scm>

   <issueManagement>
      <url>https://github.com/alexander-perucci/spring-grow/issues</url>
      <system>GitHub Issues</system>
   </issueManagement>

   <distributionManagement>
      <repository>
         <id>oss-sonatype-releases</id>
         <name>OSS sonatype Release Repository</name>
         <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
      </repository>
      <snapshotRepository>
         <id>oss-sonatype-snapshots</id>
         <name>OSS sonatype Snapshots Repository</name>
         <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
      </snapshotRepository>
   </distributionManagement>

   <developers>
      <developer>
         <id>alexander_perucci</id>
         <name>Alexander Perucci</name>
         <email>aleale89@hotmail.it</email>
         <url>http://www.alexanderperucci.com/</url>
         <roles>
            <role>developer</role>
         </roles>
         <timezone>Italy/Rome</timezone>
      </developer>
   </developers>

   <build>
      <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.3</version>
            <configuration>
               <source>${maven.compiler.source}</source>
               <target>${maven.compiler.target}</target>
               <useIncrementalCompilation>false</useIncrementalCompilation>
               <showWarnings>true</showWarnings>
               <showDeprecation>true</showDeprecation>
               <compilerArgument>-Xlint:unchecked</compilerArgument>
            </configuration>
         </plugin>
         <!-- Disable default license check and enforce specific -->
         <plugin>
            <groupId>com.mycila</groupId>
            <artifactId>license-maven-plugin</artifactId>
            <version>${license-maven-plugin.version}</version>
            <inherited>true</inherited>
            <configuration>
               <skip>true</skip>
            </configuration>
         </plugin>
         <plugin>
            <groupId>org.apache.rat</groupId>
            <artifactId>apache-rat-plugin</artifactId>
            <version>${apache-rat-plugin.version}</version>
            <configuration>
               <excludes>
                  <exclude>**/archetype-resources/**</exclude>
               </excludes>
            </configuration>
            <executions>
               <execution>
                  <id>rat-check</id>
                  <phase>verify</phase>
                  <goals>
                     <goal>check</goal>
                  </goals>
               </execution>
            </executions>
         </plugin>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-invoker-plugin</artifactId>
            <version>${maven-invoker-plugin.version}</version>
            <configuration>
               <cloneProjectsTo>${project.build.directory}/integration-test</cloneProjectsTo>
               <goals>
                  <goal>org.apache.maven.plugins:maven-archetype-plugin:generate</goal>
               </goals>
               <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
               <pomIncludes>
                  <pomInclude>*</pomInclude>
               </pomIncludes>
               <projectsDirectory>${basedir}/src/integration-test/</projectsDirectory>
               <properties>
                  <archetypeArtifactId>${project.artifactId}</archetypeArtifactId>
                  <archetypeGroupId>${project.groupId}</archetypeGroupId>
                  <archetypeVersion>${project.version}</archetypeVersion>
                  <archetypeRepository>local</archetypeRepository>
                  <goals>verify</goals>
                  <interactiveMode>false</interactiveMode>
               </properties>
               <streamLogs>true</streamLogs>
            </configuration>
            <executions>
               <execution>
                  <id>integration-test</id>
                  <goals>
                     <goal>install</goal>
                     <goal>run</goal>
                  </goals>
               </execution>
            </executions>
         </plugin>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-release-plugin</artifactId>
            <version>${maven-release-plugin.version}</version>
            <configuration>
               <goals>deploy</goals>
               <useReleaseProfile>false</useReleaseProfile>
               <releaseProfiles>release</releaseProfiles>
               <autoVersionSubmodules>true</autoVersionSubmodules>
               <arguments>-Prelease ${arguments}</arguments>
               <waitBeforeTagging>10</waitBeforeTagging>
               <mavenExecutorId>forked-path</mavenExecutorId>
               <tagNameFormat>@{project.artifactId}-@{project.version}</tagNameFormat>
            </configuration>
         </plugin>
      </plugins>
   </build>

   <profiles>
      <profile>
         <id>release</id>
         <build>
            <plugins>      
               <plugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-deploy-plugin</artifactId>
                  <version>${maven-deploy-plugin.version}</version>
               </plugin>
               <plugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-gpg-plugin</artifactId>
                  <version>${maven-gpg-plugin.version}</version>
                  <executions>
                     <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                           <goal>sign</goal>
                        </goals>
                     </execution>
                  </executions>
               </plugin>
               <plugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-javadoc-plugin</artifactId>
                  <version>${maven-javadoc-plugin.version}</version>
                  <executions>
                     <execution>
                        <id>attach-javadocs</id>
                        <goals>
                           <goal>jar</goal>
                        </goals>
                     </execution>
                  </executions>
               </plugin>
               <plugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-source-plugin</artifactId>
                  <version>${maven-source-plugin.version}</version>
                  <executions>
                     <execution>
                        <id>attach-sources</id>
                        <goals>
                           <goal>jar-no-fork</goal>
                        </goals>
                     </execution>
                  </executions>
               </plugin>          
            </plugins>
         </build>
      </profile>
   </profiles>
</project>