<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>io.github.noahhhx</groupId>
  <artifactId>oysh</artifactId>
  <version>0.0.2</version>
  <packaging>pom</packaging>

  <name>oysh</name>
  <description>SSH-served interactive shell for Java apps.</description>
  <url>https://github.com/noahhhx/oysh</url>

  <licenses>
    <license>
      <name>GNU Affero General Public License v3.0</name>
      <url>https://www.gnu.org/licenses/agpl-3.0.html</url>
      <distribution>repo</distribution>
      <comments>
        Free for open source projects. For commercial/closed-source licensing,
        contact noah@noahhh.co.uk.
      </comments>
    </license>
  </licenses>

  <developers>
    <developer>
      <name>Noah Giles</name>
      <email>noah@noahhh.co.uk</email>
      <organization>oysh</organization>
    </developer>
  </developers>
  
  <modules>
    <module>oysh-core</module>
    <module>oysh-example</module>
    <module>oysh-spring-boot-starter</module>
    <module>oysh-example/oysh-spring-boot-example</module>
  </modules>

  <scm>
    <connection>scm:git:git://github.com/noahhhx/oysh.git</connection>
    <developerConnection>scm:git:ssh://github.com/noahhhx/oysh.git</developerConnection>
    <url>https://github.com/noahhhx/oysh</url>
  </scm>

  <properties>
    <maven.compiler.source>17</maven.compiler.source>
    <maven.compiler.target>17</maven.compiler.target>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    
    <!-- Dependency Versions -->
    <sshd.version>2.14.0</sshd.version>
    <jline.version>3.27.1</jline.version>
    <picocli.version>4.7.2</picocli.version>
  </properties>

  <dependencyManagement>
    <dependencies>

      <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-dependencies</artifactId>
        <version>3.5.14</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>

      <dependency>
        <groupId>org.apache.sshd</groupId>
        <artifactId>sshd-core</artifactId>
        <version>${sshd.version}</version>
      </dependency>
      
      <dependency>
        <groupId>org.jline</groupId>
        <artifactId>jline</artifactId>
        <version>${jline.version}</version>
      </dependency>

      <dependency>
        <groupId>info.picocli</groupId>
        <artifactId>picocli</artifactId>
        <version>${picocli.version}</version>
      </dependency>
      <dependency>
        <groupId>info.picocli</groupId>
        <artifactId>picocli-shell-jline3</artifactId>
        <version>${picocli.version}</version>
      </dependency>
      
    </dependencies>
  </dependencyManagement>
  
  <profiles>
    <profile>
      <id>deployment</id>
      <build>
        <plugins>
          
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>3.12.0</version>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>3.4.0</version>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>3.2.8</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>org.sonatype.central</groupId>
            <artifactId>central-publishing-maven-plugin</artifactId>
            <version>0.10.0</version>
            <extensions>true</extensions>
              <configuration>
               <publishingServerId>central</publishingServerId>
               <autoPublish>true</autoPublish>
               <waitUntil>uploaded</waitUntil>
               <centralSnapshotsUrl>https://central.sonatype.com/repository/maven-snapshots/</centralSnapshotsUrl>
             </configuration>
          </plugin>
          
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
