<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>

  <parent>
    <groupId>org.jboss</groupId>
    <artifactId>jboss-parent</artifactId>
    <version>36</version>
  </parent>

  <groupId>org.jboss.pnc.build-agent</groupId>
  <artifactId>parent</artifactId>
  <version>1.0.2</version>
  <packaging>pom</packaging>

  <name>PNC Build Agent</name>
  <description>PNC Build Agent is used to expose shell like interface via Http and WebSockets of the host running the agent. It can be used to execute remote command and get the command output back via WebSocket, command completion is notified via WebSocket. It can also handle file uploads and downloads.</description>

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

  <scm>
    <connection>scm:git:https://github.com/project-ncl/pnc-build-agent.git</connection>
    <developerConnection>scm:git:git@github.com:project-ncl/pnc-build-agent.git</developerConnection>
    <url>https://github.com/project-ncl/pnc-build-agent/</url>
    <tag>1.0.2</tag>
  </scm>

  <properties>
    <version.io.termd>1.1.9</version.io.termd>
    <version.undertow>2.2.3.Final</version.undertow>
    <version.junit>4.13.1</version.junit>
    <version.org.slf4j>1.7.25</version.org.slf4j>
    <version.commons-cli>1.4</version.commons-cli>
    <version.jackson>2.12.3</version.jackson>
    <version.jackson.databind>2.12.3</version.jackson.databind>
    <version.logback.contrib>0.1.5</version.logback.contrib>

    <jdk.min.version>1.8</jdk.min.version>
    <maven.min.version>3.2</maven.min.version>

    <maven.compiler.target>1.8</maven.compiler.target>
    <maven.compiler.source>1.8</maven.compiler.source>

    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <modules>
    <module>client</module>
    <module>server</module>
    <module>common</module>
    <module>api</module>
    <module>logback</module>
  </modules>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.jboss.pnc.build-agent</groupId>
        <artifactId>common</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>org.jboss.pnc.build-agent</groupId>
        <artifactId>api</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>org.jboss.pnc.build-agent</groupId>
        <artifactId>logback</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>org.jboss.pnc.build-agent</groupId>
        <artifactId>client</artifactId>
        <scope>test</scope>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>org.jboss.pnc</groupId>
        <artifactId>pnc-api</artifactId>
        <version>2.1.0</version>
      </dependency>
      <dependency>
        <groupId>org.jboss.pnc</groupId>
        <artifactId>pnc-common</artifactId>
        <version>2.1.0</version>
      </dependency>

      <dependency>
        <groupId>io.termd</groupId>
        <artifactId>termd-core</artifactId>
        <version>${version.io.termd}</version>
        <exclusions>
          <exclusion>
            <groupId>io.netty</groupId>
            <artifactId>netty-common</artifactId>
          </exclusion>
          <exclusion>
            <groupId>io.netty</groupId>
            <artifactId>netty-buffer</artifactId>
          </exclusion>
          <exclusion>
            <groupId>io.netty</groupId>
            <artifactId>netty-transport</artifactId>
          </exclusion>
          <exclusion>
            <groupId>io.netty</groupId>
            <artifactId>netty-handler</artifactId>
          </exclusion>
          <exclusion>
            <groupId>io.netty</groupId>
            <artifactId>netty-codec-http</artifactId>
          </exclusion>
        </exclusions>
      </dependency>

      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${version.org.slf4j}</version>
      </dependency>

      <dependency>
        <groupId>org.jboss.logmanager</groupId>
        <artifactId>jboss-logmanager</artifactId>
        <version>2.1.7.Final</version>
      </dependency>

      <dependency>
        <groupId>org.jboss.slf4j</groupId>
        <artifactId>slf4j-jboss-logmanager</artifactId>
        <version>1.0.4.GA</version>
      </dependency>

      <dependency>
        <groupId>org.jboss.logmanager</groupId>
        <artifactId>jboss-logmanager-ext</artifactId>
        <version>1.0.0.Alpha5</version>
      </dependency>
      <dependency>
        <groupId>org.glassfish</groupId>
        <artifactId>javax.json</artifactId>
        <version>1.1.4</version>
      </dependency>
      <dependency>
        <groupId>org.jboss.logmanager</groupId>
        <artifactId>log4j-jboss-logmanager</artifactId>
        <version>1.1.6.Final</version>
      </dependency>
      <dependency>
        <groupId>org.wildfly.core</groupId>
        <artifactId>wildfly-logging</artifactId>
        <version>8.0.0.Final</version>
        <exclusions>
          <exclusion>
            <groupId>org.jboss.msc</groupId>
            <artifactId>jboss-msc</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.jboss.modules</groupId>
            <artifactId>jboss-modules</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.jboss</groupId>
            <artifactId>jboss-dmr</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.jboss</groupId>
            <artifactId>jboss-vfs</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.wildfly.core</groupId>
            <artifactId>wildfly-controller</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.wildfly.core</groupId>
            <artifactId>wildfly-network</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.wildfly.core</groupId>
            <artifactId>wildfly-server</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.wildfly.security</groupId>
            <artifactId>wildfly-elytron</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.jboss.stdio</groupId>
            <artifactId>jboss-stdio</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.jboss</groupId>
            <artifactId>staxmapper</artifactId>
          </exclusion>
        </exclusions>
      </dependency>

      <dependency>
        <groupId>org.apache.kafka</groupId>
        <artifactId>kafka-log4j-appender</artifactId>
        <version>2.1.1</version>
        <exclusions>
          <exclusion>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>io.undertow</groupId>
        <artifactId>undertow-core</artifactId>
        <version>${version.undertow}</version>
      </dependency>
      <dependency>
        <groupId>io.undertow</groupId>
        <artifactId>undertow-websockets-jsr</artifactId>
        <version>${version.undertow}</version>
      </dependency>

      <dependency>
        <groupId>commons-cli</groupId>
        <artifactId>commons-cli</artifactId>
        <version>${version.commons-cli}</version>
      </dependency>

      <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-core</artifactId>
        <version>${version.jackson}</version>
      </dependency>

      <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-databind</artifactId>
        <version>${version.jackson.databind}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.kafka</groupId>
        <artifactId>kafka-clients</artifactId>
        <version>2.2.0</version>
      </dependency>
      <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-classic</artifactId>
        <version>1.2.3</version>
      </dependency>
      <dependency>
        <groupId>ch.qos.logback.contrib</groupId>
        <artifactId>logback-jackson</artifactId>
        <version>${version.logback.contrib}</version>
      </dependency>
      <dependency>
        <groupId>ch.qos.logback.contrib</groupId>
        <artifactId>logback-json-classic</artifactId>
        <version>${version.logback.contrib}</version>
      </dependency>
      <dependency>
        <groupId>org.keycloak</groupId>
        <artifactId>keycloak-servlet-filter-adapter</artifactId>
        <version>13.0.1</version>
      </dependency>

      <!-- Test dependencies -->
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>${version.junit}</version>
        <scope>test</scope>
      </dependency>

    </dependencies>
  </dependencyManagement>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-enforcer-plugin</artifactId>
          <dependencies>
            <dependency>
              <groupId>org.commonjava.maven.enforcer</groupId>
              <artifactId>enforce-managed-deps-rule</artifactId>
              <version>1.2</version>
            </dependency>
          </dependencies>
          <executions>
            <execution>
              <id>no-managed-deps</id>
              <goals>
                <goal>enforce</goal>
              </goals>
              <phase>initialize</phase>
              <configuration>
                <rules>
                  <requireManagedDeps implementation="org.commonjava.maven.enforcer.rule.EnforceManagedDepsRule">
                    <checkProfiles>true</checkProfiles>
                    <failOnViolation>true</failOnViolation>
                    <regexIgnored>
                      <regexIgnored>[{]</regexIgnored>
                    </regexIgnored>
                  </requireManagedDeps>
                </rules>
              </configuration>
            </execution>

            <execution>
              <id>enforce-java-version</id>
              <goals>
                <goal>enforce</goal>
              </goals>
              <configuration>
                <rules>
                  <requireJavaVersion>
                    <message>To build this project JDK ${jdk.min.version} (or greater) is required. Please install it.</message>
                    <version>${jdk.min.version}</version>
                  </requireJavaVersion>
                </rules>
              </configuration>
            </execution>
            <execution>
              <id>enforce-maven-version</id>
              <goals>
                <goal>enforce</goal>
              </goals>
              <configuration>
                <rules>
                  <requireMavenVersion>
                    <message>To build this project Maven ${maven.min.version} (or greater) is required. Please install it.</message>
                    <version>${maven.min.version}</version>
                  </requireMavenVersion>
                </rules>
              </configuration>
            </execution>
          </executions>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <configuration>
            <archive>
              <index>true</index>
              <manifest>
                <addDefaultSpecificationEntries>
                  true
                </addDefaultSpecificationEntries>
                <addDefaultImplementationEntries>
                  true
                </addDefaultImplementationEntries>
              </manifest>
              <manifestEntries>
                <Implementation-URL>${project.url}</Implementation-URL>
                <Java-Version>${java.version}</Java-Version>
                <Java-Vendor>${java.vendor}</Java-Vendor>
                <Os-Name>${os.name}</Os-Name>
                <Os-Arch>${os.arch}</Os-Arch>
                <Os-Version>${os.version}</Os-Version>
                <Scm-Url>${project.scm.url}</Scm-Url>
                <Scm-Connection>${project.scm.connection}</Scm-Connection>
                <Scm-Revision>${buildNumber}</Scm-Revision>
                <Build-Timestamp>${datetime}</Build-Timestamp>
              </manifestEntries>
            </archive>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <configuration>
            <source>8</source>
          </configuration>
          <executions>
            <execution>
              <id>attach-javadocs</id>
              <goals>
                <goal>jar</goal>
              </goals>
            </execution>
          </executions>
        </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>
    </pluginManagement>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>buildnumber-maven-plugin</artifactId>
        <executions>
          <execution>
            <phase>validate</phase>
            <id>buildnumber</id>
            <goals>
              <goal>create</goal>
            </goals>
            <configuration>
              <shortRevisionLength>8</shortRevisionLength>
              <timestampFormat>{0,date,dd MMMM yyyy}</timestampFormat>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <version>2.5.3</version>
        <configuration>
          <tagNameFormat>@{project.version}</tagNameFormat>
          <autoVersionSubmodules>true</autoVersionSubmodules>
          <useReleaseProfile>false</useReleaseProfile>
          <releaseProfiles>gpg-sign,release</releaseProfiles>
          <goals>deploy</goals>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <repositories>
    <repository>
      <id>jboss-snapshots</id>
      <url>https://repository.jboss.org/nexus/content/repositories/snapshots</url>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
      <releases>
        <enabled>false</enabled>
      </releases>
    </repository>
    <repository>
      <id>jboss</id>
      <url>https://repository.jboss.org/</url>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <releases>
        <enabled>true</enabled>
      </releases>
    </repository>
  </repositories>

  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
