<?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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>org.microbean</groupId>
  <artifactId>microbean-openwebbeans-environment</artifactId>
  <version>0.0.2</version>
  <packaging>pom</packaging>

  <parent>
    <groupId>org.microbean</groupId>
    <artifactId>microbean-pluginmanagement-pom</artifactId>
    <version>9</version>
    <relativePath />
  </parent>

  <name>microBean OpenWebBeans Environment</name>
  <description>${project.name}</description>
  <inceptionYear>2017</inceptionYear>
  <url>https://microbean.github.io/${project.artifactId}</url>

  <scm>
    <connection>scm:git:git@github.com:microbean/${project.artifactId}.git</connection>
    <developerConnection>scm:git:git@github.com:microbean/${project.artifactId}.git</developerConnection>
    <url>https://github.com/microbean/${project.artifactId}/</url>
    <tag>v0.0.2</tag>
  </scm>

  <dependencyManagement>
    <dependencies>


      <!-- Imports. -->
      

      <dependency>
        <groupId>org.microbean</groupId>
        <artifactId>microbean-abstract-environment</artifactId>
        <version>0.5.2</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>


      <!-- Normal dependencies. -->
      
      
      <dependency>
        <groupId>${project.groupId}</groupId>
        <artifactId>${project.artifactId}</artifactId>
        <version>${project.version}</version>
        <type>pom</type>
      </dependency>

      <dependency>
        <groupId>org.apache.openwebbeans</groupId>
        <artifactId>openwebbeans-se</artifactId>
        <version>2.0.8</version>
        <type>jar</type>
      </dependency>
      
      <dependency>
        <groupId>org.jboss</groupId>
        <artifactId>jandex</artifactId>
        <version>2.0.5.Final</version>
        <type>jar</type>
      </dependency>

      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-jdk14</artifactId>
        <version>1.8.0-beta2</version>
        <type>jar</type>
      </dependency>
      
    </dependencies>
  </dependencyManagement>

  <dependencies>
    

    <!-- Runtime-scoped dependencies. -->

    
    <dependency>
      <groupId>org.jboss</groupId>
      <artifactId>jandex</artifactId>
      <type>jar</type>
      <scope>runtime</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.openwebbeans</groupId>
      <artifactId>openwebbeans-se</artifactId>
      <type>jar</type>
      <scope>runtime</scope>
    </dependency>
    
    <dependency>
      <groupId>org.microbean</groupId>
      <artifactId>microbean-abstract-environment</artifactId>
      <type>pom</type>
      <scope>runtime</scope>
    </dependency>

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-jdk14</artifactId>
      <type>jar</type>
      <scope>runtime</scope>
    </dependency>

  </dependencies>

  <build>

    <pluginManagement>
      <plugins>

        <plugin>
          <artifactId>maven-project-info-reports-plugin</artifactId>
          <version>3.0.0</version>
        </plugin>
        
        <plugin>
          <groupId>io.fabric8</groupId>
          <artifactId>docker-maven-plugin</artifactId>
          <version>0.27.2</version>
        </plugin>

        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>buildnumber-maven-plugin</artifactId>
          <version>1.4</version>
        </plugin>
        
      </plugins>
    </pluginManagement>
    
    <plugins>

      <plugin>
        <groupId>com.github.github</groupId>
        <artifactId>site-maven-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>io.fabric8</groupId>
        <artifactId>docker-maven-plugin</artifactId>
        <configuration>
          <images>
            <image>
              <name>microbean/microbean-openwebbeans:%l</name>
              <build>
                <from>docker.io/microbean/microbean-base:0.5.2</from>
                <assembly>
                  <targetDir>/microbean</targetDir>
                  <inline>
                    <dependencySets>
                      <dependencySet>
                        <useProjectArtifact>false</useProjectArtifact>
                        <excludes>
                          <exclude>*:pom:*</exclude>
                        </excludes>
                      </dependencySet>
                    </dependencySets>
                  </inline>
                  <user>microbean:microbean:microbean</user>
                </assembly>
                <labels>
                  <build.git.sha1>${buildNumber}</build.git.sha1>
                  <build.git.branch>${scmBranch}</build.git.branch>
                  <build.timestamp>${timestamp}</build.timestamp>
                </labels>
                <cmd>
                  <exec>
                    <arg>org.microbean.main.Main</arg>
                  </exec>
                </cmd>
                <tags>
                  <tag>latest</tag>
                </tags>
                <user>microbean</user>
                <workdir>/microbean</workdir>
              </build>
            </image>
          </images>
        </configuration>
        <executions>
          <execution>
            <id>Build Docker image</id>
            <goals>
              <goal>build</goal>
            </goals>
            <phase>install</phase>
          </execution>
          <execution>
            <id>Push Docker image</id>
            <goals>
              <goal>push</goal>
            </goals>
            <phase>deploy</phase>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>buildnumber-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>Retrieve current build number (Git commit id)</id>
            <phase>initialize</phase>
            <goals>
              <goal>create</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      
    </plugins>
  </build>

</project>
