<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>
    <groupId>org.extism.sdk</groupId>
    <artifactId>extism</artifactId>
    <packaging>jar</packaging>
    <version>0.3.0</version>
    <name>extism</name>
    <url>https://github.com/extism/extism</url>
    <description>Java-SDK for Extism to use webassembly from Java</description>

    <licenses>
        <license>
            <name>BSD 3-Clause</name>
            <url>https://opensource.org/licenses/BSD-3-Clause</url>
        </license>
    </licenses>

    <organization>
        <name>Dylibso, Inc.</name>
        <url>https://dylib.so</url>
    </organization>

    <developers>
        <developer>
            <name>The Extism Authors</name>
            <email>oss@extism.org</email>
            <roles>
                <role>Maintainer</role>
            </roles>
            <organization>Dylibso, Inc.</organization>
            <organizationUrl>https://dylib.so</organizationUrl>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git://github.com/extism/extism.git</connection>
        <developerConnection>scm:git:ssh://git@github.com/extism/extism.git</developerConnection>
        <url>https://github.com/extism/extism/tree/main/java</url>
        <tag>main</tag>
    </scm>

    <issueManagement>
        <system>Github</system>
        <url>https://github.com/extism/extism/issues</url>
    </issueManagement>

    <properties>
        <java.version>11</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <!-- dependencies -->
        <jna.version>5.12.1</jna.version>
        <gson.version>2.10</gson.version>

        <!-- testing -->
        <junit-jupiter-engine.version>5.9.1</junit-jupiter-engine.version>
        <assertj-core.version>3.23.1</assertj-core.version>

        <!-- maven plugins -->
        <maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
        <maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>

        <!-- jreleaser -->
        <jreleaser.git.root.search>true</jreleaser.git.root.search>
    </properties>

    <profiles>
      <profile>
        <id>release</id>
        <build>
          <plugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-javadoc-plugin</artifactId>
              <version>3.4.1</version>
              <configuration>
               <additionalJOption>-Xdoclint:none</additionalJOption>
              </configuration>
              <executions>
                <execution>
                  <id>attach-javadoc</id>
                  <goals>
                    <goal>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-source</id>
                  <goals>
                    <goal>jar</goal>
                  </goals>
                </execution>
              </executions>
            </plugin>
            <plugin>
              <groupId>org.jreleaser</groupId>
              <artifactId>jreleaser-maven-plugin</artifactId>
              <version>1.3.1</version>
              <configuration>
                <jreleaser>
                  <release>
                    <github>
                      <skipRelease>true</skipRelease>
                    </github>
                  </release>
                  <signing>
                    <active>ALWAYS</active>
                    <armored>true</armored>
                  </signing>
                  <deploy>
                    <maven>
                      <nexus2>
                        <maven-central>
                          <active>ALWAYS</active>
                          <url>https://s01.oss.sonatype.org/service/local</url>
                          <!--
                          <closeRepository>false</closeRepository>
                          <releaseRepository>false</releaseRepository>
                          -->
                          <stagingRepositories>target/staging-deploy</stagingRepositories>
                        </maven-central>
                      </nexus2>
                    </maven>
                  </deploy>
                </jreleaser>
              </configuration>
            </plugin>
          </plugins>
        </build>
      </profile>
    </profiles>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven-compiler-plugin.version}</version>
                <configuration>
                    <release>${java.version}</release>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven-surefire-plugin.version}</version>
                <configuration>
                    <systemPropertyVariables>
                        <jna.library.path>../target/release</jna.library.path>
                    </systemPropertyVariables>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupId>net.java.dev.jna</groupId>
            <artifactId>jna</artifactId>
            <version>${jna.version}</version>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>${gson.version}</version>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>${junit-jupiter-engine.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <version>${assertj-core.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>uk.org.webcompere</groupId>
            <artifactId>model-assert</artifactId>
            <version>1.0.0</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>
