<?xml version="1.0" encoding="UTF-8"?>
<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>
    <parent>
        <groupId>org.jboss</groupId>
        <artifactId>jboss-parent</artifactId>
        <version>39</version>
    </parent>
    <groupId>dev.jbang</groupId>
    <artifactId>jbang-maven-plugin</artifactId>
    <version>0.0.8</version>
    <packaging>maven-plugin</packaging>

    <name>JBang Maven Plugin</name>

    <url>https://jbang.dev</url>

    <prerequisites>
        <maven>${mavenMinRuntime.version}</maven>
    </prerequisites>

    <licenses>
        <license>
            <name>MIT License</name>
            <url>http://www.opensource.org/licenses/mit-license.php</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>gastaldi</id>
            <name>George Gastaldi</name>
        </developer>
        <developer>
            <id>maxandersen</id>
            <name>Max Rydahl Andersen</name>
        </developer>
    </developers>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <!-- picked up by: compiler, javadoc -->
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <mavenMinRuntime.version>3.6.0</mavenMinRuntime.version>
        <maven.version>3.9.6</maven.version>
        <mavenPluginTools.version>3.10.2</mavenPluginTools.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.zeroturnaround</groupId>
            <artifactId>zt-exec</artifactId>
            <version>1.12</version>
        </dependency>
        <dependency>
            <groupId>org.twdata.maven</groupId>
            <artifactId>mojo-executor</artifactId>
            <version>2.4.0</version>
        </dependency>
        <!-- Upgrade of plexus-utils for mojo-executor -->
        <!-- Important: to keep Maven3 compat, remain in [3,4) range! -->
        <dependency>
            <groupId>org.codehaus.plexus</groupId>
            <artifactId>plexus-utils</artifactId>
            <version>3.5.1</version>
        </dependency>

        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-plugin-api</artifactId>
            <version>${maven.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-core</artifactId>
            <version>${maven.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.plugin-tools</groupId>
            <artifactId>maven-plugin-annotations</artifactId>
            <version>${mavenPluginTools.version}</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-plugin-plugin</artifactId>
                <version>${mavenPluginTools.version}</version>
                <configuration>
                    <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
                </configuration>
                <executions>
                    <execution>
                        <id>mojo-descriptor</id>
                        <goals>
                            <goal>descriptor</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>help-goal</id>
                        <goals>
                            <goal>helpmojo</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
              <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.7</version>
                <extensions>true</extensions>
                <configuration>
                   <serverId>ossrh</serverId>
                   <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                   <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
              </plugin>
        </plugins>
    </build>
    <scm>
        <connection>scm:git:https://github.com/jbangdev/jbang-maven-plugin</connection>
        <developerConnection>scm:git:https://github.com/jbangdev/jbang-maven-plugin</developerConnection>
        <url>https://github.com/jbangdev/jbang-maven-plugin</url>
        <tag>HEAD</tag>
    </scm>
    <distributionManagement>
        <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>
    <profiles>
        <profile>
            <id>it</id>
            <activation>
                <property>
                    <name>skipTests</name>
                    <value>!true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>mrm-maven-plugin</artifactId>
                        <version>1.5.0</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>start</goal>
                                    <goal>stop</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <propertyName>repository.proxy.url</propertyName>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-invoker-plugin</artifactId>
                        <version>3.6.0</version>
                        <configuration>
                            <debug>false</debug>
                            <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
                            <pomIncludes>
                                <pomInclude>*/pom.xml</pomInclude>
                            </pomIncludes>
                            <postBuildHookScript>verify</postBuildHookScript>
                            <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
                            <settingsFile>src/it/settings.xml</settingsFile>
                            <streamLogs>true</streamLogs>
                            <filterProperties>
                                <repository.proxy.url>${repository.proxy.url}</repository.proxy.url>
                            </filterProperties>
                        </configuration>
                        <dependencies>
                            <dependency>
                                <groupId>org.apache.groovy</groupId>
                                <artifactId>groovy-all</artifactId>
                                <version>4.0.16</version>
                                <type>pom</type>
                            </dependency>
                        </dependencies>
                        <executions>
                            <execution>
                                <id>integration-test</id>
                                <goals>
                                    <goal>install</goal>
                                    <goal>integration-test</goal>
                                    <goal>verify</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>release-sign-artifacts</id>
            <activation>
              <property>
                <name>release</name>
                <value>true</value>
              </property>
            </activation>
            <build>
              <plugins>
                <plugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-gpg-plugin</artifactId>
                  <configuration>
                      <gpgArguments>
                          <arg>--pinentry-mode</arg>
                          <arg>loopback</arg>
                      </gpgArguments>
                  </configuration>
                  <executions>
                    <execution>
                      <id>sign-artifacts</id>
                      <phase>verify</phase>
                      <goals>
                        <goal>sign</goal>
                      </goals>
                    </execution>
                  </executions>
                </plugin>
              </plugins>
            </build>
        </profile>
    </profiles>
</project>
