<?xml version="1.0" encoding="UTF-8"?>
<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.jboss</groupId>
    <artifactId>jboss-parent</artifactId>
    <version>25</version>
  </parent>

  <groupId>io.fabric8.forge</groupId>
  <artifactId>fabric8-generator</artifactId>
  <version>1.0.74</version>

  <properties>
    <fabric8.version>3.0.3</fabric8.version>
    <fabric8.maven.plugin.version>3.5.28</fabric8.maven.plugin.version>

    <version.furnace>2.25.4.Final</version.furnace>
    <version.forge>3.6.1.Final</version.forge>
    <version.wildfly-swarm>2017.3.3</version.wildfly-swarm>
    <fabric8-forge.version>2.3.90</fabric8-forge.version>
    <version.vertx>1.2.1</version.vertx>
    <kohsuke.github-api.version>1.84</kohsuke.github-api.version>
    <infinispan-embedded.version>9.0.0.CR2</infinispan-embedded.version>
    <launchpad-addon.version>17</launchpad-addon.version>

    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
    <maven.enforcer.plugin.version>1.4</maven.enforcer.plugin.version>
    <maven.javadoc.plugin.version>2.10.3</maven.javadoc.plugin.version>

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

  <scm>
    <connection>scm:git:git://github.com/fabric8io/fabric8-generator-addon.git</connection>
    <developerConnection>scm:git:git@github.com:fabric8io/fabric8-generator-addon.git</developerConnection>
    <url>http://github.com/fabric8io/fabric8-generator-addon</url>
  </scm>

  <distributionManagement>
    <repository>
      <id>oss-sonatype-staging</id>
      <name>Sonatype Staging Repository</name>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
    </repository>
    <snapshotRepository>
      <id>oss-sonatype-snapshots</id>
      <name>OSS Sonatype Nexus Snapshots</name>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
  </distributionManagement>

  <!-- including A developer as it's required by the maven poms going into central -->
  <developers>
    <developer>
      <id>geeks</id>
      <name>Fabric8 Development Team</name>
      <email>fabric8@googlegroups.com</email>
      <organization>fabric8</organization>
      <organizationUrl>http://fabric8.io/</organizationUrl>
    </developer>
  </developers>

  <repositories>
    <repository>
      <id>central.maven.org</id>
      <url>http://central.maven.org/maven2</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
    <repository>
      <id>repo.jenkins-ci.org</id>
      <url>http://repo.jenkins-ci.org/public</url>
    </repository>
    <repository>
      <id>jboss-public-repo</id>
      <url>https://repository.jboss.org/nexus/content/groups/public</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
  </repositories>


  <build>
    <finalName>fabric8-generator</finalName>

    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
      </resource>
    </resources>

    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-gpg-plugin</artifactId>
          <version>1.5</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>${maven.javadoc.plugin.version}</version>
          <configuration>
            <additionalparam>${javadoc.opts}</additionalparam>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <!--
               <plugin>
                  <groupId>org.codehaus.mojo</groupId>
                  <artifactId>exec-maven-plugin</artifactId>
                  <executions>
                     <execution>
                        <id>flush-archetypes</id>
                        <phase>prepare-package</phase>
                        <goals>
                           <goal>java</goal>
                        </goals>
                        <configuration>
                           <mainClass>org.obsidiantoaster.generator.ui.quickstart.FlushArchetypes</mainClass>
                           <classpathScope>compile</classpathScope>
                           <arguments>
                              <argument>https://repository.jboss.org/nexus/service/local/artifact/maven/redirect?r=public&amp;g=org.obsidiantoaster&amp;a=archetypes-catalog&amp;v=${project.version}&amp;e=xml&amp;c=archetype-catalog</argument>
                              <argument>${project.build.directory}/classes/org/obsidiantoaster/generator/ui/quickstart</argument>
                           </arguments>
                        </configuration>
                     </execution>
                  </executions>
               </plugin>
      -->
      <!--
               <plugin>
                  <artifactId>maven-release-plugin</artifactId>
                  <configuration>
                     <releaseProfiles>gpg-sign,jboss-release,release</releaseProfiles>
                     <tagNameFormat>@{project.version}</tagNameFormat>
                  </configuration>
               </plugin>
      -->
      <!--
               <plugin>
                  <groupId>org.sonatype.plugins</groupId>
                  <artifactId>nexus-staging-maven-plugin</artifactId>
                  <version>1.6.3</version>
                  <extensions>true</extensions>
                  <configuration>
                     <autoReleaseAfterClose>true</autoReleaseAfterClose>
                     <serverId>${serverId}</serverId>
                     <nexusUrl>${nexusUrl}</nexusUrl>
                     <skipStaging>${skipStaging}</skipStaging>
                  </configuration>
               </plugin>
      -->
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
          <execution>
            <id>create-forge-addon</id>
            <phase>package</phase>
            <goals>
              <goal>jar</goal>
            </goals>
            <configuration>
              <classifier>forge-addon</classifier>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>io.fabric8</groupId>
        <artifactId>fabric8-project</artifactId>
        <version>${fabric8.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>org.jboss.forge</groupId>
        <artifactId>forge-bom</artifactId>
        <version>${version.forge}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>org.kohsuke</groupId>
      <artifactId>github-api</artifactId>
      <version>${kohsuke.github-api.version}</version>
    </dependency>
    <dependency>
      <groupId>org.infinispan</groupId>
      <artifactId>infinispan-embedded</artifactId>
      <version>${infinispan-embedded.version}</version>
    </dependency>

    <dependency>
      <groupId>io.openshift.launchpad</groupId>
      <artifactId>launchpad-addon</artifactId>
      <version>${launchpad-addon.version}</version>
      <classifier>forge-addon</classifier>
    </dependency>


    <dependency>
      <groupId>io.fabric8.forge</groupId>
      <artifactId>utils</artifactId>
      <version>${fabric8-forge.version}</version>
    </dependency>

    <dependency>
      <groupId>io.fabric8</groupId>
      <artifactId>kubernetes-api</artifactId>
      <exclusions>
        <exclusion>
          <groupId>org.slf4j</groupId>
          <artifactId>slf4j-api</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.slf4j</groupId>
          <artifactId>jul-to-slf4j</artifactId>
        </exclusion>
      </exclusions>
    </dependency>


    <dependency>
      <!-- TODO we should be able to remove this dependency -->
      <groupId>io.fabric8</groupId>
      <artifactId>fabric8-devops</artifactId>
    </dependency>
    <dependency>
      <groupId>io.fabric8</groupId>
      <artifactId>fabric8-project-utils</artifactId>
      <exclusions>
        <exclusion>
          <groupId>io.fabric8</groupId>
          <artifactId>gitrepo-api</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>io.fabric8</groupId>
      <artifactId>gitrepo-resteasy</artifactId>
      <exclusions>
        <exclusion>
          <groupId>org.jboss.resteasy</groupId>
          <artifactId>*</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
      <groupId>com.auth0</groupId>
      <artifactId>java-jwt</artifactId>
      <version>3.1.0</version>
    </dependency>

    <dependency>
      <groupId>org.jboss.forge.addon</groupId>
      <artifactId>rest-client</artifactId>
      <classifier>forge-addon</classifier>
    </dependency>

    <!--
          <dependency>
             <groupId>org.jboss.forge.addon</groupId>
             <artifactId>slf4j</artifactId>
             <classifier>forge-addon</classifier>
          </dependency>
          <dependency>
             <groupId>org.jboss.forge.addon</groupId>
             <artifactId>maven</artifactId>
             <classifier>javaee-api</classifier>
             <classifier>forge-addon</classifier>
          </dependency>
    -->

    <dependency>
      <groupId>me.escoffier.forge</groupId>
      <artifactId>vertx-forge-addon</artifactId>
      <classifier>forge-addon</classifier>
      <version>${version.vertx}</version>
    </dependency>
    <dependency>
      <groupId>org.jboss.forge.addon</groupId>
      <artifactId>wildfly-swarm</artifactId>
      <classifier>forge-addon</classifier>
      <version>${version.wildfly-swarm}</version>
    </dependency>

    <dependency>
      <groupId>org.jboss.forge.furnace.container</groupId>
      <artifactId>cdi</artifactId>
      <classifier>forge-addon</classifier>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.jboss.forge.addon</groupId>
      <artifactId>ui</artifactId>
      <classifier>forge-addon</classifier>
    </dependency>

    <dependency>
      <groupId>org.jboss.forge.addon</groupId>
      <artifactId>projects</artifactId>
      <classifier>forge-addon</classifier>
    </dependency>

    <dependency>
      <groupId>org.jboss.forge.addon</groupId>
      <artifactId>maven</artifactId>
      <classifier>forge-addon</classifier>
    </dependency>

    <dependency>
      <groupId>org.jboss.forge.addon</groupId>
      <artifactId>maven-impl-projects</artifactId>
      <version>${version.forge}</version>
      <scope>provided</scope>
    </dependency>


    <dependency>
      <groupId>org.jboss.forge.addon</groupId>
      <artifactId>templates</artifactId>
      <classifier>forge-addon</classifier>
    </dependency>

    <dependency>
      <groupId>org.jboss.forge.furnace.test</groupId>
      <artifactId>furnace-test-harness</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jboss.forge.furnace.test</groupId>
      <artifactId>arquillian-furnace-classpath</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jglue.cdi-unit</groupId>
      <artifactId>cdi-unit</artifactId>
      <version>3.0.0</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <profiles>
    <profile>
      <id>release</id>
      <activation/>
      <build>
        <plugins>
          <plugin>
            <groupId>org.jboss.forge.furnace</groupId>
            <artifactId>furnace-maven-plugin</artifactId>
            <version>${version.furnace}</version>
            <executions>
              <execution>
                <id>generate-dot</id>
                <phase>prepare-package</phase>
                <goals>
                  <goal>generate-dot</goal>
                </goals>
                <configuration>
                  <attach>true</attach>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-enforcer-plugin</artifactId>
            <version>${maven.enforcer.plugin.version}</version>
            <executions>
              <execution>
                <id>enforce-no-snapshots</id>
                <goals>
                  <goal>enforce</goal>
                </goals>
                <configuration>
                  <rules>
                    <requireReleaseDeps>
                      <message>No Snapshots Allowed!</message>
                    </requireReleaseDeps>
                  </rules>
                  <fail>true</fail>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
                <configuration>
                  <additionalparam>${javadoc.opts}</additionalparam>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>2.4</version>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>snapshot</id>
      <properties>
        <obsidian-generator.version>1.0.0-SNAPSHOT</obsidian-generator.version>
      </properties>
    </profile>
    <profile>
      <id>doclint-java8-disable</id>
      <activation>
        <jdk>[1.8,)</jdk>
      </activation>
      <properties>
        <javadoc.opts>-Xdoclint:none</javadoc.opts>
      </properties>
    </profile>
  </profiles>
</project>
