<!--

    Copyright © 2019 admin (admin@infrastructurebuilder.org)

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<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.infrastructurebuilder.util</groupId>
    <artifactId>iblogging-root</artifactId>
  <version>0.9.0</version>
  </parent>
  <artifactId>iblogconfig</artifactId>
  <packaging>jar</packaging>
  <name>${project.artifactId}</name>
  <description>Generate configs for various logging environments.  See docs for how to create a new environment.</description>
  <properties>
    <surefire.failIfNoTests>false</surefire.failIfNoTests>
  </properties>
  <dependencies>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
    </dependency>
  </dependencies>
  <build>
    <plugins>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <configuration>
          <resources>
            <resource>
              <directory>src/main/attached-resources</directory>
              <filtering>true</filtering>
            </resource>
          </resources>
        </configuration>
        <executions>
          <execution>
            <id>prod</id>
            <phase>process-resources</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.directory}/prod</outputDirectory>
              <filters>
                <filter>${basedir}/src/filters/prod.properties</filter>
              </filters>
            </configuration>
          </execution>
          <execution>
            <id>file</id>
            <phase>process-resources</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.directory}/file</outputDirectory>
              <filters>
                <filter>${basedir}/src/filters/prod.properties</filter>
                <filter>${basedir}/src/filters/file.properties</filter>
              </filters>
            </configuration>
          </execution>
          <execution>
            <id>test</id>
            <phase>process-resources</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.directory}/test</outputDirectory>
              <filters>
                <filter>${basedir}/src/filters/prod.properties</filter>
                <filter>${basedir}/src/filters/test.properties</filter>
              </filters>
            </configuration>
          </execution>
          <execution>
            <id>debug</id>
            <phase>process-resources</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.directory}/debug</outputDirectory>
              <filters>
                <filter>${basedir}/src/filters/prod.properties</filter>
                <filter>${basedir}/src/filters/debug.properties</filter>
              </filters>
            </configuration>
          </execution>
          <execution>
            <id>other</id>
            <phase>process-resources</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.directory}/other</outputDirectory>
              <filters>
                <filter>${basedir}/src/filters/prod.properties</filter>
                <filter>${basedir}/src/filters/other.properties</filter>
              </filters>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
          <execution>
            <id>prod</id>
            <phase>package</phase>
            <goals>
              <goal>jar</goal>
            </goals>
            <configuration>
              <classesDirectory>${project.build.directory}/prod</classesDirectory>
              <classifier>prod</classifier>
            </configuration>
          </execution>
          <execution>
            <id>test</id>
            <phase>package</phase>
            <goals>
              <goal>jar</goal>
            </goals>
            <configuration>
              <classesDirectory>${project.build.directory}/test</classesDirectory>
              <classifier>test</classifier>
            </configuration>
          </execution>
          <execution>
            <id>file</id>
            <phase>package</phase>
            <goals>
              <goal>jar</goal>
            </goals>
            <configuration>
              <classesDirectory>${project.build.directory}/file</classesDirectory>
              <classifier>file</classifier>
            </configuration>
          </execution>
          <execution>
            <id>debug</id>
            <phase>package</phase>
            <goals>
              <goal>jar</goal>
            </goals>
            <configuration>
              <classesDirectory>${project.build.directory}/debug</classesDirectory>
              <classifier>debug</classifier>
            </configuration>
          </execution>
          <execution>
            <id>other</id>
            <phase>package</phase>
            <goals>
              <goal>jar</goal>
            </goals>
            <configuration>
              <classesDirectory>${project.build.directory}/other</classesDirectory>
              <classifier>other</classifier>
            </configuration>
          </execution>
        </executions>
      </plugin>

<!--       <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <configuration>
          <rules>
            <rule>
              <element>BUNDLE</element>
              <excludes>
                <exclude>*Test</exclude>
              </excludes>
              <limits>
                <limit>
                  <counter>INSTRUCTION</counter>
                  <value>COVEREDRATIO</value>
                  <minimum>${jacoco.coverage.minimum}</minimum>
                </limit>
              </limits>
            </rule>
          </rules>
        </configuration>
      </plugin>
 -->
    </plugins>
  </build>
</project>
