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

    <groupId>com.intuit.karate</groupId>
    <artifactId>karate-parent</artifactId>
    <version>1.2.0</version>
    <packaging>pom</packaging>
    
    <name>${project.artifactId}</name>
    <description>Test Automation Made Simple</description>
    <url>https://github.com/karatelabs/karate</url>
    <licenses>
        <license>
            <name>MIT License</name>
            <url>http://www.opensource.org/licenses/mit-license.php</url>
            <distribution>repo</distribution>
        </license>
    </licenses>
    <scm>
        <url>https://github.com/karatelabs/karate</url>
        <connection>scm:git:git://github.com/karatelabs/karate.git</connection>
        <developerConnection>scm:git:git@github.com:karatelabs/karate.git</developerConnection>
    </scm>
    <developers>
        <developer>
            <name>Peter Thomas</name>
            <id>ptrthomas</id>
            <organization>Karate Labs Inc.</organization>
            <organizationUrl>http://karatelabs.io</organizationUrl>
        </developer>
    </developers>       

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <java.version>1.8</java.version>
        <maven.compiler.version>3.8.1</maven.compiler.version>
        <maven.surefire.version>2.22.2</maven.surefire.version>
        <maven.shade.version>3.2.4</maven.shade.version>
        <junit.version>4.13.1</junit.version>
        <junit5.version>5.7.2</junit5.version>
        <nexus.staging.plugin.version>1.6.8</nexus.staging.plugin.version>
        <spring.version>5.3.19</spring.version>
        <spring.boot.version>2.6.6</spring.boot.version>
        <jacoco.plugin.version>0.7.9</jacoco.plugin.version>
    </properties>

    <modules>
        <module>karate-core</module>
        <module>karate-junit4</module>
        <module>karate-junit5</module>
        <module>karate-demo</module>
        <module>karate-gatling</module>
        <module>karate-mock-servlet</module>
        <module>karate-robot</module>        
        <module>karate-e2e-tests</module>
        <module>karate-archetype</module>
    </modules>

    <build>       
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven.compiler.version}</version>
                <configuration>
                    <encoding>UTF-8</encoding>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                    <!-- <compilerArgument>-Werror</compilerArgument> -->
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven.surefire.version}</version>
                <configuration>
                    <argLine>-Dfile.encoding=UTF-8</argLine>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.2.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>                                                          
        </plugins>
    </build>
    
    <profiles>
        <profile> 
            <id>depcheck</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.owasp</groupId>
                        <artifactId>dependency-check-maven</artifactId>
                        <version>6.5.0</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>aggregate</goal>
                                </goals>
                                <configuration>
                                    <failBuildOnCVSS>0</failBuildOnCVSS>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin> 
                </plugins>
            </build>
        </profile>        
        <profile> 
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>2.9.1</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                                <configuration>
                                    <additionalparam>-Xdoclint:none</additionalparam>
                                </configuration>                                
                            </execution>
                        </executions>
                    </plugin>
                    <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>
                                <configuration>
                                    <gpgArguments>
                                        <arg>--pinentry-mode</arg>
                                        <arg>loopback</arg>
                                    </gpgArguments>
                                </configuration>                                                           
                            </execution>                            
                        </executions>                                                                                         
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>${nexus.staging.plugin.version}</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <stagingProfileId>476c7dd0c49efa</stagingProfileId>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                            <stagingProgressTimeoutMinutes>10</stagingProgressTimeoutMinutes>
                            <stagingProgressPauseDurationSeconds>15</stagingProgressPauseDurationSeconds>                            
                        </configuration>
                        <dependencies>
                            <!--
                              TODO: remove after OSSRH-66257, NEXUS-26993 are fixed
                              possibly via https://github.com/sonatype/nexus-maven-plugins/pull/91
                            -->
                            <dependency>
                                <groupId>com.thoughtworks.xstream</groupId>
                                <artifactId>xstream</artifactId>
                                <version>1.4.15</version>
                            </dependency>
                        </dependencies>                        
                    </plugin>                     
                </plugins>
            </build>
        </profile>
    </profiles>    
    
    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>       
    </distributionManagement>                 
    
</project>