<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.5</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://github.com/wearefrank/ladybug</url>

  <properties>
    <revision>2.3-SNAPSHOT</revision>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <spring.version>5.3.34</spring.version>
    <cxf.version>3.5.5</cxf.version>
    <!-- The line below is parsed by the GitHub actions test that triggers the ladybug-frontend Cypress test -->

    <frontend.version>0.0.54</frontend.version>
    <!-- Logback 1.3 requires slf4j-api 2.0. Logback is used with scope test so ignore https://github.com/wearefrank/ladybug/security/dependabot until Frank!Framework starts using slf4j-api 2.0 -->
    <logback.version>1.2.13</logback.version>
    <!-- Create skip-replace-inject.txt (replacement is only needed in the published jar by CI/CD) (more info in nl/nn/testtool/Inject.java -->
    <inject.replace.include>**/*.java</inject.replace.include>
    <inject.replace.from>javax.inject</inject.replace.from>
    <inject.replace.to>nl.nn.testtool</inject.replace.to>
  </properties>

  <organization>
    <name>WeAreFrank!</name>
    <url>https://github.com/wearefrank/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@wearefrank.nl</email>
      <organization>WeAreFrank!</organization>
      <organizationUrl>https://wearefrank.nl</organizationUrl>
    </developer>
    <developer>
      <name>Niels Meijer</name>
      <email>niels@wearefrank.nl</email>
      <organization>WeAreFrank!</organization>
      <organizationUrl>https://wearefrank.nl</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.4</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.5-20240507.172631</version>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>1.7.36</version>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
      <version>3.14.0</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>
    <!-- Add Xalan to be able to run old GUI on Java 17 and higher -->
    <dependency>
      <groupId>xalan</groupId>
      <artifactId>xalan</artifactId>
      <version>2.7.3</version>
    </dependency>
    <dependency>
      <groupId>xalan</groupId>
      <artifactId>serializer</artifactId>
      <version>2.7.3</version>
    </dependency>
    <dependency>
      <groupId>org.projectlombok</groupId>
      <artifactId>lombok</artifactId>
      <version>1.18.30</version>
      <scope>provided</scope>
    </dependency>
    <!--
    OptionalJtaTransactionManager implements PlatformTransactionManager having @Nullable which will make Javadoc fail with: class file for javax.annotation.meta.When not found
    https://stackoverflow.com/questions/53326271/spring-nullable-annotation-generates-unknown-enum-constant-warning
    -->
    <dependency>
      <groupId>com.google.code.findbugs</groupId>
      <artifactId>annotations</artifactId>
      <version>3.0.1</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <version>5.10.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.10.2</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-core</artifactId>
      <version>${logback.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <version>${logback.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.h2database</groupId>
      <artifactId>h2</artifactId>
      <version>2.2.220</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.liquibase</groupId>
      <artifactId>liquibase-core</artifactId>
      <version>4.26.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-dbcp2</artifactId>
      <version>2.11.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.quarkus.arc</groupId>
      <artifactId>arc</artifactId>
      <version>1.13.4.Final</version><!-- 2.7.0.Final doesn't compile with Java 8 -->
      <scope>provided</scope>
      <exclusions>
        <!-- Exclude quarkus-core to prevent following warning when running JUnit: SLF4J: Class path contains multiple SLF4J bindings. -->
        <!-- And with jakarta.enterprise.cdi-api as a normal dependency all transitive dependencies can be excluded (Quarkus arc is then only needed for DefaultBean) -->
        <exclusion>
          <groupId>*</groupId>
          <artifactId>*</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <!-- Normal dependency instead of a transitive dependency of Quarkus arc (Spring is using the cdi-api annotations also) -->
    <dependency>
      <groupId>jakarta.enterprise</groupId>
      <artifactId>jakarta.enterprise.cdi-api</artifactId>
      <version>2.0.2</version>
      <scope>provided</scope>
    </dependency>
    <!-- Resolve @JsonbTransient -->
    <dependency>
      <groupId>javax.json.bind</groupId>
      <artifactId>javax.json.bind-api</artifactId>
      <version>1.0</version>
      <scope>provided</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>
        <groupId>com.google.code.maven-replacer-plugin</groupId>
          <artifactId>replacer</artifactId>
          <version>1.5.3</version>
          <executions>
            <execution>
                <phase>generate-resources</phase><!-- generate-resources instead of generate-sources to run after copyright check with <phase>process-sources</phase> -->
                <goals>
                  <goal>replace</goal>
                </goals>
            </execution>
          </executions>
          <configuration>
            <basedir>${basedir}</basedir>
            <includes>
              <include>${inject.replace.include}</include>
            </includes>
            <replacements>
               <replacement>
                 <token>import ${inject.replace.from}.Inject;</token>
                 <value>import ${inject.replace.to}.Inject;</value>
               </replacement>
            </replacements>
        </configuration>
      </plugin>
      <!--
        Add META-INF/jandex.idx, see also:
          https://quarkus.io/guides/cdi-reference#how-to-generate-a-jandex-index
          https://quarkus.io/guides/cdi-reference#bean_discovery
          https://quarkus.io/guides/getting-started#working-with-multi-module-project-or-external-modules
      -->
      <plugin>
        <groupId>io.smallrye</groupId>
        <artifactId>jandex-maven-plugin</artifactId>
        <version>3.1.2</version>
        <executions>
          <execution>
            <id>make-index</id>
            <goals>
              <goal>jandex</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <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.6.3</version>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
              <goal>test-jar</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <!-- Prevent following warning with JDK 11 and higher: The code being documented uses modules but the packages defined in https://docs.oracle.com/javase/8/docs/api/ are in the unnamed module. -->
          <source>1.8</source>
          <additionalJOptions>
            <!-- Make CI/CD fail on Javadoc warnings (Reports an error if any warnings occur, see https://docs.oracle.com/en/java/javase/21/docs/specs/man/javadoc.html) -->
            <additionalJOption>-Xwerror</additionalJOption>
            <!-- Prevent following warning with JDK 17 and higher: no comment (JDK 21 also gives: no main description) -->
            <additionalJOption>-Xdoclint:-missing</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>3.0.1</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>
        <configuration>
          <skip>true</skip><!-- Prevent copyright check running a second time and failing because of replacements by replacer-plugin. And speed up the build in Jenkins (generated site isn't used) -->
        </configuration>
      </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/wearefrank/ladybug</url>
    <connection>scm:git:https://github.com/wearefrank/ladybug.git</connection>
    <developerConnection>scm:git:https://github.com/wearefrank/ladybug.git</developerConnection>
    <tag>v2.5</tag>
  </scm>

  <profiles>
    <profile>
      <id>skip-replace-inject</id>
      <activation>
        <file>
          <exists>skip-replace-inject.txt</exists>
        </file>
      </activation>
      <properties>
        <inject.replace.include>DISABLE</inject.replace.include>
      </properties>
    </profile>
    <profile>
      <id>skip-copyright</id>
      <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>frankframework</id>
      <distributionManagement>
        <repository>
          <id>frankframework</id>
          <url>https://nexus.frankframework.org/content/repositories/releases</url>
        </repository>
        <snapshotRepository>
          <id>frankframework</id>
          <url>https://nexus.frankframework.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <site>
          <id>www.frankframework.org</id>
          <url>file:target/site-deploy</url>
        </site>
      </distributionManagement>
      <repositories>
        <repository>
          <id>frankframework</id>
          <url>https://nexus.frankframework.org/content/groups/public</url>
        </repository>
      </repositories>
    </profile>
    <profile>
      <id>sign</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>3.2.4</version>
            <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>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>ossrh</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>1.6.13</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.wearefrank.org</id>
          <url>file:target/site-deploy</url>
        </site>
      </distributionManagement>
    </profile>
  </profiles>
</project>
