<?xml version="1.0" encoding="UTF-8"?>
<!--
  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. See accompanying LICENSE file.
-->
<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>io.repaint.maven</groupId>
  <artifactId>tiles-maven-plugin</artifactId>
  <packaging>maven-plugin</packaging>
  <version>2.25</version>
  <name>Tiles Maven Plugin</name>

  <description>Provides composition support for Maven composition support for Maven</description>
  <url>http://repaint.io</url>

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


  <developers>
    <!-- reviewer -->
    <developer>
      <id>talios</id>
      <email>mark@talios.com</email>
      <name>Mark Derricutt</name>
    </developer>
    <!-- developer -->
    <developer>
      <id>richard</id>
      <email>richard@bluetrainsoftware.com</email>
      <name>Richard Vowles</name>
    </developer>
  </developers>

  <properties>
    <mavenVersion>3.6.3</mavenVersion>
    <groovyVersion>3.0.9</groovyVersion>
    <repaint.release>dev</repaint.release>
  </properties>

  <scm>
    <connection>scm:git:git@github.com:repaint-io/maven-tiles</connection>
    <developerConnection>scm:git:git@github.com:repaint-io/maven-tiles</developerConnection>
    <url>https://github.com/repaint-io/maven-tiles</url>
    <tag>tiles-maven-plugin-2.25</tag>
  </scm>

  <distributionManagement>
    <repository>
      <id>sonatype-staging</id>
      <name>oss.sonatype.org Staging Repository</name>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
    <snapshotRepository>
      <id>sonatype-snapshots</id>
      <name>oss.sonatype.org Snapshot Repository</name>
      <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
    </snapshotRepository>
  </distributionManagement>

  <dependencies>
    <dependency>
      <groupId>org.codehaus.groovy</groupId>
      <artifactId>groovy</artifactId>
      <version>${groovyVersion}</version>
    </dependency>
    <dependency>
    <groupId>org.codehaus.groovy</groupId>
      <artifactId>groovy-xml</artifactId>
      <version>${groovyVersion}</version>
    </dependency>
    <dependency>
    <groupId>org.codehaus.groovy</groupId>
      <artifactId>groovy-test</artifactId>
      <version>${groovyVersion}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-core</artifactId>
      <version>${mavenVersion}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.plugin-tools</groupId>
      <artifactId>maven-plugin-annotations</artifactId>
      <version>3.6.1</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-compat</artifactId>
      <version>${mavenVersion}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.shared</groupId>
      <artifactId>maven-filtering</artifactId>
      <version>3.2.0</version>
      <exclusions>
        <exclusion>
          <groupId>org.apache.maven</groupId>
          <artifactId>maven-core</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>com.bluetrainsoftware.composite</groupId>
      <artifactId>composite-unit-test</artifactId>
      <version>1.1</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <groupId>org.mockito</groupId>
          <artifactId>mockito-core</artifactId>
       </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <version>4.1.0</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <profiles>
    <profile>
      <!-- activate the sonatype profile when a release is being done -->
      <id>sonatype</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>
            <version>3.0.1</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>run-its</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-invoker-plugin</artifactId>
            <version>2.0.0</version>
            <configuration>
              <projectsDirectory>src/it</projectsDirectory>
              <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
	            <!--<mavenOpts>-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8000</mavenOpts>-->
              <pomIncludes>
                <pomInclude>*/pom.xml</pomInclude>
              </pomIncludes>
              <!-- <preBuildHookScript>setup</preBuildHookScript> -->
              <postBuildHookScript>verify</postBuildHookScript>
              <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
              <settingsFile>src/it/settings.xml</settingsFile>
              <debug>true</debug>
              <!--               <goals>
                              <goal>clean</goal>
                              <goal>verify</goal>
                            </goals>
               -->
            </configuration>
            <executions>
              <execution>
                <id>integration-test</id>
                <goals>
                  <goal>install</goal>
                  <goal>run</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-scm-plugin</artifactId>
        <version>1.11.3</version>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>3.0.0</version>
        <!-- Invocation is defined by the release plugin goal set hence no executions -->
        <configuration>
          <rules>
            <requireMavenVersion>
              <version>[3.3.9,)</version>
            </requireMavenVersion>
            <requireReleaseDeps>
              <!--  Don't allow releases with snapshop deps or parents -->
              <message>No Snapshots Allowed!</message>
              <failWhenParentIsSnapshot>true</failWhenParentIsSnapshot>
              <searchTransitive>true</searchTransitive>
            </requireReleaseDeps>
            <bannedDependencies>
              <excludes>
                <exclude>commons-logging</exclude>
                <exclude>commons-logging-api</exclude>
              </excludes>
            </bannedDependencies>
          </rules>
          <fail>true</fail>
        </configuration>
      </plugin>

      <plugin>
        <artifactId>maven-release-plugin</artifactId>
        <version>3.0.0-M4</version>
        <configuration>
          <mavenExecutorId>forked-path</mavenExecutorId>
          <arguments>-Drepaint.release=release</arguments>
          <preparationGoals>clean enforcer:enforce verify</preparationGoals>
          <goals>enforcer:enforce deploy</goals>
          <tagBase>release/${project.groupId}/</tagBase>
          <pushChanges>false</pushChanges>
          <localCheckout>true</localCheckout>
        </configuration>
      </plugin>

      <!-- allow us to be used by Java 6, even though really, I mean -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.8.1</version>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.codehaus.plexus</groupId>
        <artifactId>plexus-component-metadata</artifactId>
        <version>2.1.0</version>
        <executions>
          <execution>
            <goals>
              <goal>generate-metadata</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-plugin-plugin</artifactId>
        <version>3.6.0</version>
        <configuration>
          <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
        </configuration>
        <executions>
          <execution>
            <id>mojo-descriptor</id>
            <goals>
              <goal>descriptor</goal>
            </goals>
          </execution>
          <!-- if you want to generate help goal -->
          <execution>
            <id>generated-helpmojo</id>
            <goals>
              <goal>helpmojo</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <!-- cloudbees is failing for some reasons with 2.10 -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>3.0.0-M5</version>
      </plugin>

      <!-- not supporting mixed java/groovy compilation -->
      <plugin>
        <groupId>org.codehaus.gmavenplus</groupId>
        <artifactId>gmavenplus-plugin</artifactId>
        <version>1.12.1</version>
        <executions>
          <execution>
            <goals>
              <goal>addSources</goal>
              <goal>addTestSources</goal>
              <goal>compile</goal>
              <goal>compileTests</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <!-- groovydoc doesn't support asciidoc, yet -->
      <plugin>
        <groupId>com.bluetrainsoftware.maven</groupId>
        <artifactId>groovydoc-maven-plugin</artifactId>
        <version>2.1</version>
        <executions>
          <execution>
            <id>attach-docs</id>
            <goals>
              <goal>attach-docs</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.2.1</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

    </plugins>
  </build>
</project>
