<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright (c) 2024, WSO2 LLC. (http://www.wso2.org) All Rights Reserved.
  ~
  ~ WSO2 LLC. licenses this file to you under the Apache License,
  ~ Version 2.0 (the "License"); you may not use this file except
  ~ in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~ http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing,
  ~ software distributed under the License is distributed on an
  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  ~ KIND, either express or implied. See the License for the
  ~ specific language governing permissions and limitations
  ~ under the License.
  -->
<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.wso2</groupId>
    <artifactId>wso2</artifactId>
    <version>1.4</version>
  </parent>

  <scm>
    <connection>scm:git:https://github.com/wso2/runtime-diagnostic-tool.git</connection>
    <developerConnection>scm:git:https://github.com/wso2/runtime-diagnostic-tool.git</developerConnection>
    <url>https://github.com/wso2/runtime-diagnostic-tool.git</url>
    <tag>v1.0.19</tag>
  </scm>

  <groupId>org.wso2.runtime.diagnostics</groupId>
  <artifactId>runtime-diagnostics-tool</artifactId>
  <version>1.0.19</version>

  <name>WSO2 Runtime Diagnostics Tool</name>
  <description>Diagnostics tool for data collection during error scenario</description>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <google.json.simple.version>1.1.1</google.json.simple.version>
    <log4j2.version>2.17.1</log4j2.version>
    <junit.version>4.13.1</junit.version>
    <commons.lang3.version>3.12.0</commons.lang3.version>
    <tuweni.toml.version>2.4.2</tuweni.toml.version>
    <commons.math.version>3.6.1</commons.math.version>
    <commons.net.version>3.10.0</commons.net.version>
    <google.gson.version>2.9.0</google.gson.version>
    <cava.toml.version>0.5.0</cava.toml.version>
    <appasembler.plugin.version>2.0.0</appasembler.plugin.version>
  </properties>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-core</artifactId>
      <version>${log4j2.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-core</artifactId>
      <version>${log4j2.version}</version>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
      <version>${commons.lang3.version}</version>
    </dependency>
    <dependency>
      <groupId>net.consensys.cava</groupId>
      <artifactId>cava-toml</artifactId>
      <version>${cava.toml.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-math3</artifactId>
      <version>${commons.math.version}</version>
    </dependency>
    <dependency>
      <groupId>commons-net</groupId>
      <artifactId>commons-net</artifactId>
      <version>${commons.net.version}</version>
    </dependency>
    <dependency>
      <groupId>com.google.code.gson</groupId>
      <artifactId>gson</artifactId>
      <version>${google.gson.version}</version>
    </dependency>
    <dependency>
      <groupId>com.github.mwiede</groupId>
      <artifactId>jsch</artifactId>
      <version>0.2.16</version>
    </dependency>
  </dependencies>

  <build>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <configuration>
            <preparationGoals>clean install</preparationGoals>
            <autoVersionSubmodules>true</autoVersionSubmodules>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-deploy-plugin</artifactId>
        </plugin>
          <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-compiler-plugin</artifactId>
              <configuration>
                  <source>11</source>
                  <target>11</target>
              </configuration>
          </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>appassembler-maven-plugin</artifactId>
          <version>${appasembler.plugin.version}</version>
          <configuration>
            <assembleDirectory>target/runtime-diagnostics</assembleDirectory>
            <useWildcardClassPath>true</useWildcardClassPath>
            <configurationSourceDirectory>src/main/assembly/resources/conf</configurationSourceDirectory>
            <configurationDirectory>conf</configurationDirectory>
            <copyConfigurationDirectory>true</copyConfigurationDirectory>
            <repositoryLayout>flat</repositoryLayout>
            <repositoryName>lib</repositoryName>
            <programs>
              <program>
                <mainClass>org.wso2.diagnostics.DiagnosticsApp</mainClass>
                <id>diagnostics</id>
              </program>
            </programs>
          </configuration>
          <executions>
            <execution>
              <id>assemble</id>
              <goals>
                <goal>assemble</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-assembly-plugin</artifactId>
          <executions>
            <execution>
              <id>dist</id>
              <phase>package</phase>
              <goals>
                <goal>single</goal>
              </goals>
              <configuration>
                <appendAssemblyId>false</appendAssemblyId>
                <descriptors>
                  <descriptor>${basedir}/src/main/assembly/bin.xml</descriptor>
                </descriptors>
                <archiverConfig>
                  <defaultDirectoryMode>0775</defaultDirectoryMode>
                  <directoryMode>0775</directoryMode>
                  <defaultFileMode>0644</defaultFileMode>
                  <fileMode>0644</fileMode>
                </archiverConfig>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <configuration>
                <attach>false</attach>
            </configuration>
        </plugin>
      </plugins>
  </build>
  <distributionManagement>
    <repository>
      <id>nexus-releases</id>
      <name>WSO2 Nexus Release Repository</name>
      <url>https://maven.wso2.org/nexus/service/local/staging/deploy/maven2/</url>
    </repository>
  </distributionManagement>

  <repositories>
    <repository>
      <id>wso2-nexus</id>
      <name>WSO2 internal Repository</name>
      <url>https://maven.wso2.org/nexus/content/groups/wso2-public/</url>
      <releases>
        <enabled>true</enabled>
        <updatePolicy>daily</updatePolicy>
        <checksumPolicy>ignore</checksumPolicy>
      </releases>
    </repository>
  </repositories>

  <pluginRepositories>
    <pluginRepository>
      <id>wso2.releases</id>
      <name>WSO2 internal Repository</name>
      <url>https://maven.wso2.org/nexus/content/repositories/releases/</url>
      <releases>
        <enabled>true</enabled>
        <updatePolicy>daily</updatePolicy>
        <checksumPolicy>ignore</checksumPolicy>
      </releases>
    </pluginRepository>
    <pluginRepository>
      <id>wso2.snapshots</id>
      <name>Apache Snapshot Repository</name>
      <url>https://maven.wso2.org/nexus/content/repositories/snapshots/</url>
      <snapshots>
        <enabled>true</enabled>
        <updatePolicy>daily</updatePolicy>
      </snapshots>
      <releases>
        <enabled>false</enabled>
      </releases>
    </pluginRepository>
    <pluginRepository>
      <id>wso2-nexus</id>
      <name>WSO2 internal Repository</name>
      <url>https://maven.wso2.org/nexus/content/groups/wso2-public/</url>
      <releases>
        <enabled>true</enabled>
        <updatePolicy>daily</updatePolicy>
        <checksumPolicy>ignore</checksumPolicy>
      </releases>
    </pluginRepository>
  </pluginRepositories>
</project>
