<?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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>com.atlassian.pom</groupId>
        <artifactId>central-pom</artifactId>
        <version>6.2.2</version>
    </parent>

    <groupId>com.atlassian.ta</groupId>
    <artifactId>wiremock-pact-generator</artifactId>
    <version>2.4.3</version>

    <name>Wiremock Pact Generator</name>
    <description>Generation of Pact files from the live interactions of WireMock stubs.</description>
    <url>https://bitbucket.org/atlassian/wiremock-pact-generator</url>

    <inceptionYear>2017</inceptionYear>
    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
            <comments>A business-friendly OSS license</comments>
        </license>
    </licenses>
    <issueManagement>
        <system>Bitbucket</system>
        <url>https://bitbucket.org/atlassian/wiremock-pact-generator/issues</url>
    </issueManagement>
    <scm>
        <connection>scm:git:ssh://git@bitbucket.org/atlassian/wiremock-pact-generator.git</connection>
        <developerConnection>scm:git:ssh://git@bitbucket.org/atlassian/wiremock-pact-generator.git</developerConnection>
        <url>https://bitbucket.org/atlassian/wiremock-pact-generator/src</url>
      <tag>v2.4.3</tag>
    </scm>

    <developers>
        <developer>
            <name>Ben Sayers</name>
            <email>bsayers@atlassian.com</email>
            <organization>Atlassian</organization>
            <organizationUrl>https://www.atlassian.com/</organizationUrl>
        </developer>
        <developer>
            <name>Sebastian Tello</name>
            <email>stello@atlassian.com</email>
            <organization>Atlassian</organization>
            <organizationUrl>https://www.atlassian.com/</organizationUrl>
        </developer>
    </developers>

    <properties>
        <jdk.version>1.8</jdk.version>
        <source.encoding>UTF-8</source.encoding>

        <wiremock.version>2.27.0</wiremock.version>
        <gson.version>2.8.9</gson.version>
        <junit.version>4.13.2</junit.version>
        <hamcrest.version>2.2</hamcrest.version>
        <mockito.version>4.1.0</mockito.version>
        <json-schema-validator.version>2.2.14</json-schema-validator.version>
        <unirest.version>1.4.9</unirest.version>
        <checkstyle.version>9.1</checkstyle.version>

        <license-maven-plugin.version>1.9</license-maven-plugin.version>
        <maven-checkstyle-plugin.version>3.1.2</maven-checkstyle-plugin.version>
        <frontend-maven-plugin.version>1.11.3</frontend-maven-plugin.version>
        <node.version>16.13.0</node.version>
        <npm.version>8.1.3</npm.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.github.tomakehurst</groupId>
            <artifactId>wiremock</artifactId>
            <version>${wiremock.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>${gson.version}</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>${mockito.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.github.java-json-tools</groupId>
            <artifactId>json-schema-validator</artifactId>
            <version>${json-schema-validator.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest</artifactId>
            <version>${hamcrest.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.mashape.unirest</groupId>
            <artifactId>unirest-java</artifactId>
            <version>${unirest.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>${license-maven-plugin.version}</version>
                <configuration>
                    <licenseMerges>
                        <licenseMerge>
                            The Apache Software License, Version 2.0|
                            Apache 2|Apache 2.0|Apache License 2.0|
                            Apache 2.0 License|Apache License, Version 2.0|
                            Apache Software License, version 2.0|
                            Apache License Version 2.0|Apache|
                            Apache Software License - Version 2.0
                        </licenseMerge>
                        <licenseMerge>
                            The MIT License (MIT)|
                            MIT License|The MIT License|MIT
                        </licenseMerge>
                        <licenseMerge>
                            BSD 3-Clause|
                            BSD|New BSD License
                        </licenseMerge>
                        <licenseMerge>
                            Common Development and Distribution License (CDDL) v1.0|
                            CDDL
                        </licenseMerge>
                        <licenseMerge>
                            Lesser General Public License (LGPL), version 3|
                            Lesser General Public License, version 3 or greater|LGPL v3
                        </licenseMerge>
                    </licenseMerges>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>${maven-checkstyle-plugin.version}</version>
                <configuration>
                    <configLocation>checkstyle.xml</configLocation>
                    <encoding>${source.encoding}</encoding>
                    <includeTestSourceDirectory>true</includeTestSourceDirectory>
                    <consoleOutput>true</consoleOutput>
                    <failsOnError>true</failsOnError>
                    <linkXRef>false</linkXRef>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>com.puppycrawl.tools</groupId>
                        <artifactId>checkstyle</artifactId>
                        <version>${checkstyle.version}</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <phase>process-sources</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>com.github.eirslett</groupId>
                <artifactId>frontend-maven-plugin</artifactId>
                <version>${frontend-maven-plugin.version}</version>
                <configuration>
                    <nodeVersion>v${node.version}</nodeVersion>
                </configuration>
                <executions>
                    <execution>
                        <id>install node and npm</id>
                        <goals>
                            <goal>install-node-and-npm</goal>
                        </goals>
                        <configuration>
                            <nodeVersion>v${node.version}</nodeVersion>
                            <npmVersion>${npm.version}</npmVersion>
                        </configuration>
                    </execution>
                    <execution>
                        <id>npm install</id>
                        <goals>
                            <goal>npm</goal>
                        </goals>
                        <phase>verify</phase>

                        <configuration>
                            <arguments>install</arguments>
                        </configuration>
                    </execution>
                    <execution>
                        <id>npm run lint-commits</id>
                        <goals>
                            <goal>npm</goal>
                        </goals>
                        <phase>verify</phase>

                        <configuration>
                            <arguments>run lint-commits</arguments>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>wiremock-1.57</id>
            <properties>
                <wiremock.version>1.57</wiremock.version>
            </properties>
        </profile>
        <profile>
            <id>wiremock-2.5</id>
            <properties>
                <wiremock.version>2.5.1</wiremock.version>
            </properties>
        </profile>
        <profile>
            <id>wiremock-2.11</id>
            <properties>
                <wiremock.version>2.11.0</wiremock.version>
            </properties>
        </profile>
        <profile>
            <id>wiremock-2.14</id>
            <properties>
                <wiremock.version>2.14.0</wiremock.version>
            </properties>
        </profile>

        <profile>
            <id>changelog</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.github.eirslett</groupId>
                        <artifactId>frontend-maven-plugin</artifactId>
                        <version>${frontend-maven-plugin.version}</version>
                        <configuration>
                            <nodeVersion>v${node.version}</nodeVersion>
                        </configuration>
                        <executions>
                            <execution>
                                <id>install node and npm</id>
                                <goals>
                                    <goal>install-node-and-npm</goal>
                                </goals>
                                <configuration>
                                    <nodeVersion>v${node.version}</nodeVersion>
                                    <npmVersion>${npm.version}</npmVersion>
                                </configuration>
                            </execution>
                            <execution>
                                <id>npm install</id>
                                <goals>
                                    <goal>npm</goal>
                                </goals>
                                <phase>package</phase>

                                <configuration>
                                    <arguments>install</arguments>
                                </configuration>
                            </execution>
                            <execution>
                                <id>npm run generate-changelog</id>
                                <goals>
                                    <goal>npm</goal>
                                </goals>
                                <phase>package</phase>

                                <configuration>
                                    <arguments>run generate-changelog</arguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
