<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>org.ibissource</groupId>
  <artifactId>ibis-ladybug</artifactId>
  <version>2.2</version>

  <name>Ladybug Test Tool</name>
  <description>
  Ladybug adds message based debugging and message based unit testing and system testing to your Java application. Call
  Ladybug at certain checkpoints in you code (either directly or using AOP) to generate tree based reports. Implement a
  rerun method to be able to rerun reports and optionally stub certain checkpoints for regression testing.
  </description>
  <url>https://ibissource.org/</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <spring.version>5.3.21</spring.version>
    <cxf.version>3.4.7</cxf.version>
    <!-- The line below is parsed by the GitHub actions test that triggers the ladybug-frontend Cypress test -->
    <frontend.version>0.0.33</frontend.version>
  </properties>

  <organization>
    <name>WeAreFrank!</name>
    <url>https://github.com/ibissource/ibis-ladybug</url>
  </organization>

  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>manual</distribution>
    </license>
  </licenses>

  <developers>
    <developer>
      <name>Jaco de Groot</name>
      <email>jaco@ibissource.org</email>
      <organization>Ibissource</organization>
      <organizationUrl>https://ibissource.org</organizationUrl>
    </developer>
    <developer>
      <name>Niels Meijer</name>
      <email>niels@ibissource.org</email>
      <organization>Ibissource</organization>
      <organizationUrl>https://ibissource.org</organizationUrl>
    </developer>
  </developers>

  <dependencies>
    <!--
    https://www.npmjs.com/package/@wearefrank/ladybug
    https://www.webjars.org/all (search for @wearefrank/ladybug)
    https://search.maven.org/artifact/org.webjars.npm/wearefrank__ladybug
    -->
    <dependency>
      <groupId>org.webjars.npm</groupId>
      <artifactId>wearefrank__ladybug</artifactId>
      <version>${frontend.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.cxf</groupId>
      <artifactId>cxf-rt-rs-client</artifactId>
      <version>${cxf.version}</version>
    </dependency>
    <dependency>
        <groupId>com.fasterxml.jackson.jaxrs</groupId>
        <artifactId>jackson-jaxrs-json-provider</artifactId>
        <version>2.13.0</version>
        <exclusions>
            <!-- Copied exclusion from iaf-core/pom.xml -->
            <exclusion>
                <groupId>jakarta.activation</groupId>
                <artifactId>jakarta.activation-api</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>javax.servlet-api</artifactId>
      <version>3.1.0</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.ibissource</groupId>
      <artifactId>ibis-echo2</artifactId>
      <version>2.0.4</version>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>1.7.30</version>
    </dependency>
    <dependency>
      <groupId>commons-lang</groupId>
      <artifactId>commons-lang</artifactId>
      <version>2.6</version>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-beans</artifactId>
      <version>${spring.version}</version>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-context</artifactId>
      <version>${spring.version}</version>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-jdbc</artifactId>
      <version>${spring.version}</version>
    </dependency>
    <dependency>
      <groupId>net.sf.saxon</groupId>
      <artifactId>Saxon-HE</artifactId>
      <version>10.8</version>
    </dependency>
    <dependency>
      <groupId>org.ibissource</groupId>
      <artifactId>ibis-xerces</artifactId>
      <version>2.12.1-xml-schema-1.1</version>
    </dependency>
    <dependency>
      <groupId>org.projectlombok</groupId>
      <artifactId>lombok</artifactId>
      <version>1.18.10</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <version>5.8.2</version>
      <scope>test</scope>
    </dependency>
    <!-- https://junit.org/junit5/docs/current/user-guide/#migrating-from-junit4 -->
    <dependency>
      <groupId>org.junit.vintage</groupId>
      <artifactId>junit-vintage-engine</artifactId>
      <version>5.8.2</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-core</artifactId>
      <version>1.2.10</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <version>1.2.10</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.h2database</groupId>
      <artifactId>h2</artifactId>
      <version>2.1.212</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.liquibase</groupId>
      <artifactId>liquibase-core</artifactId>
      <version>4.10.0</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <repositories>
    <!-- Enable ibis-echo2 timestamp versions -->
    <repository>
      <id>ibissource</id>
      <name>Ibissource</name>
      <url>https://nexus.frankframework.org/content/repositories/public</url>
    </repository>
  </repositories>

  <build>
    <defaultGoal>install</defaultGoal>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.10.1</version>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>3.2.2</version>
        <configuration>
          <archive>
            <addMavenDescriptor>true</addMavenDescriptor>
            <manifest>
              <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
              <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
            </manifest>
          </archive>
        </configuration>
        <executions><!-- Create a test jar for ibis-ladybug-test-webapp to depend on. See also https://maven.apache.org/plugins/maven-jar-plugin/examples/create-test-jar.html -->
          <execution>
            <goals>
              <goal>test-jar</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>
            <phase>prepare-package</phase>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.4.1</version>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
              <goal>test-jar</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <additionalJOptions>
            <additionalJOption>-Xwerror</additionalJOption>
          </additionalJOptions>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.22.2</version>
        <configuration>
          <!-- redirectTestOutputToFile>true</redirectTestOutputToFile -->
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-deploy-plugin</artifactId>
        <version>2.8.2</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <version>2.5.3</version>
        <configuration>
          <tagNameFormat>v@{project.version}</tagNameFormat>
          <autoVersionSubmodules>true</autoVersionSubmodules>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.commonjava.maven.plugins</groupId>
        <artifactId>directory-maven-plugin</artifactId>
        <version>1.0</version>
        <executions>
          <execution>
            <id>find-project-root-directory</id>
            <goals>
              <goal>directory-of</goal>
            </goals>
            <phase>initialize</phase>
            <configuration>
              <property>ibis.ladybug.rootdir</property>
              <project>
                <groupId>org.ibissource</groupId>
                <artifactId>ibis-ladybug</artifactId>
              </project>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
        <version>3.12.1</version>
      </plugin>
    </plugins>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.eclipse.m2e</groupId>
          <artifactId>lifecycle-mapping</artifactId>
          <version>1.0.0</version>
          <configuration>
            <lifecycleMappingMetadata>
              <pluginExecutions>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.glassfish.copyright</groupId>
                    <artifactId>glassfish-copyright-maven-plugin</artifactId>
                    <versionRange>[2.4,)</versionRange>
                    <goals>
                      <goal>check</goal>
                      <goal>copyright</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore />
                  </action>
                </pluginExecution>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.commonjava.maven.plugins</groupId>
                    <artifactId>directory-maven-plugin</artifactId>
                    <versionRange>[1.0,)</versionRange>
                    <goals>
                      <goal>directory-of</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore />
                  </action>
                </pluginExecution>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <versionRange>[3.1.2,)</versionRange>
                    <goals>
                      <goal>check</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore />
                  </action>
                </pluginExecution>
              </pluginExecutions>
            </lifecycleMappingMetadata>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <version>3.4.1</version>
      </plugin>
      <!-- http://maven.apache.org/plugins/maven-javadoc-plugin/usage.html 
        Generate Javadocs As Part Of Project Reports -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.4.1</version>
      </plugin>
    </plugins>
  </reporting>

  <scm>
    <url>https://github.com/ibissource/ibis-ladybug</url>
    <connection>scm:git:https://github.com/ibissource/ibis-ladybug.git</connection>
    <developerConnection>scm:git:https://github.com/ibissource/ibis-ladybug.git</developerConnection>
    <tag>v2.2</tag>
  </scm>

  <profiles>
    <profile>
      <activation>
        <property>
          <name>!maven.skip.copyright</name>
          <value>!true</value>
        </property>
      </activation> 
      <build>
        <plugins>
          <plugin>
            <groupId>org.glassfish.copyright</groupId>
            <artifactId>glassfish-copyright-maven-plugin</artifactId>
            <version>2.4</version>
            <executions>
              <execution>
                <id>Check-CopyRight-Notice</id>
                <goals>
                  <goal>copyright</goal><!-- Checks for Copyright notices -->
                  <goal>check</goal><!-- Fails the build -->
                </goals>
                <phase>process-sources</phase>
              </execution>
            </executions>
            <configuration>
              <excludeFile>${ibis.ladybug.rootdir}${file.separator}copyrightExcludeFile.txt</excludeFile>
              <useDash>true</useDash>
              <templateFile>${ibis.ladybug.rootdir}/copyrightTemplateFile.txt</templateFile>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>ossrh</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.6</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <passphrase>${gpg.passphrase}</passphrase>
              <gpgArguments>
                <!-- This is necessary for gpg to not try to use the pinentry programs -->
                <arg>--batch</arg>
                <arg>--no-tty</arg>
                <arg>--pinentry-mode</arg>
                <arg>loopback</arg>
              </gpgArguments>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-release-plugin</artifactId>
            <version>2.5.3</version>
            <configuration>
              <autoVersionSubmodules>true</autoVersionSubmodules>
              <useReleaseProfile>false</useReleaseProfile>
              <releaseProfiles>release</releaseProfiles>
              <goals>deploy</goals>
              <tagNameFormat>v@{project.version}</tagNameFormat>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>1.6.8</version>
            <extensions>true</extensions>
            <configuration>
              <serverId>ossrh</serverId>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
              <autoReleaseAfterClose>false</autoReleaseAfterClose>
            </configuration>
          </plugin>
        </plugins>
      </build>
      <distributionManagement>
        <repository>
          <id>ossrh</id>
          <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
        <snapshotRepository>
          <id>ossrh</id>
          <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <site>
          <id>www.ibissource.org</id>
          <url>file:target/site-deploy</url>
        </site>
      </distributionManagement>
    </profile>
    <profile>
      <id>ibissource</id>
      <distributionManagement>
        <repository>
          <id>ibissource</id>
          <url>https://nexus.frankframework.org/content/repositories/releases</url>
        </repository>
        <snapshotRepository>
          <id>ibissource</id>
          <url>https://nexus.frankframework.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <site>
          <id>www.ibissource.org</id>
          <url>file:target/site-deploy</url>
        </site>
      </distributionManagement>
    </profile>
  </profiles>
</project>
