<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>com.github.sergiofgonzalez</groupId>
  <artifactId>waterfall-config</artifactId>
  <version>1.0.0</version>

  <packaging>jar</packaging>  

  <name>waterfall-config</name>
  <url>https://github.com/sergiofgonzalez/waterfall-config</url>
  <licenses>
    <license>
      <name>MIT license</name>
      <url>https://opensource.org/licenses/MIT</url>
    </license>
  </licenses>

  <scm>
    <url>https://github.com/sergiofgonzalez/waterfall-config</url>
  </scm>

  <developers>
    <developer>
      <name>Sergio F. Gonzalez</name>
    </developer>
  </developers>

  <description>
        See README.md for details.
  </description>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <java.version>1.8</java.version>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
    
    <config.version>1.3.1</config.version>
    <junit.version>4.12</junit.version>    
    <log4j.version>1.2.17</log4j.version>
    <slf4j.version>1.7.16</slf4j.version>
    <assertj.version>3.8.0</assertj.version>
  </properties>
  
  
  <dependencies>
        
    <!-- ### Typesafe's Config ### -->
    <dependency>
      <groupId>com.typesafe</groupId>
      <artifactId>config</artifactId>
      <version>${config.version}</version>
    </dependency>
        
    <!-- ### SLF4J ### -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>${slf4j.version}</version>
    </dependency>
    
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
      <version>${slf4j.version}</version>
    </dependency>
    
    <!-- ### Log4j ### -->
    <dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
      <version>1.2.17</version>
    </dependency>
        
    <!-- ### Test ### -->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>
    
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <version>${assertj.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
  
  <build>
    <plugins>
      <!-- Testing the artifact -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.20</version>
        <configuration>
          <!-- uncomment to run only the tests tagged with @Category(ActiveTest.class) 
          <groups>com.github.sergiofgonzalez.test.utils.categories.ActiveTest</groups> 
          -->
          <reuseForks>false</reuseForks>
          <includes>
            <!-- The only file available is config/common  -->
            <include>WaterfallConfigCommonConfEncryptionTests</include>
            <include>WaterfallConfigCommonConfNoEncryptionTests</include>
            
            <!-- config/common merged with app level config file within the jar -->
            <include>WaterfallConfigAppConfNoEncryptionNoProfilesTests</include>            
            <include>WaterfallConfigAppConfEncryptionNoProfilesTests</include>
            <include>WaterfallConfigAppConfNoEncryptionProfilesTests</include>
            <include>WaterfallConfigAppConfEncryptionProfilesTests</include>
            
            <!-- External to jar app level config file -->
            <include>WaterfallConfigExtConfNoEncryptionNoProfilesTests</include>
            <include>WaterfallConfigExtConfEncryptionNoProfilesTests</include>
            <include>WaterfallConfigExtConfNoEncryptionProfilesTests</include>
            
            <!-- Errors Raised Tests -->
            <include>WaterfallConfigEncryptionUnexistingKeyErrorTests</include>
            <include>WaterfallConfigEncryptionUnexistingAlgorithmErrorTests</include>
            
            <!-- Scanning of External Paths Tests -->
            <include>WaterfallConfigExtPathTests</include>
          </includes>
          <environmentVariables>
            <in_common_but_overridden_by_env>This value has been set in an environment variable</in_common_but_overridden_by_env>
            <in_common_but_overridden_by_env_and_property>This value has been set in an environment variable</in_common_but_overridden_by_env_and_property>
            <encrypted_value_in_common_and_env>cipher(PiWreyV5lSH8rqPP7/08lrLF6jCz68QnEIATISRAecef1iqzauHXgkzU9JUIumZ2hSlMyD057eDcDeGoDTRXeoTH1Ptp3nSHb41zAXXYvAE=)</encrypted_value_in_common_and_env>
            <encrypted_value_in_env_var>cipher(PiWreyV5lSH8rqPP7/08lrLF6jCz68QnEIATISRAecef1iqzauHXgkzU9JUIumZ2hSlMyD057eDcDeGoDTRXeoTH1Ptp3nSHb41zAXXYvAE=)</encrypted_value_in_env_var>
            <encrypted_value_in_env_var_and_system_prop>cipher(PiWreyV5lSH8rqPP7/08lrLF6jCz68QnEIATISRAecef1iqzauHXgkzU9JUIumZ2hSlMyD057eDcDeGoDTRXeoTH1Ptp3nSHb41zAXXYvAE=)</encrypted_value_in_env_var_and_system_prop>
            <in_application001_but_overridden_by_env>This value has been set in an environment variable</in_application001_but_overridden_by_env>
            <in_application001_but_overridden_by_env_and_property>This value has been set in an environment variable</in_application001_but_overridden_by_env_and_property>
            <in_env_var>This value has been set in an environment variable</in_env_var>
            <in_env_var_and_system_prop>This value has been set in an environment variable</in_env_var_and_system_prop>
            <encrypted_value_in_application002_and_env>cipher(PiWreyV5lSH8rqPP7/08lrLF6jCz68QnEIATISRAecef1iqzauHXgkzU9JUIumZ2hSlMyD057eDcDeGoDTRXeoTH1Ptp3nSHb41zAXXYvAE=)</encrypted_value_in_application002_and_env>
            <in_environment_var_and_profile>This value has been set in an environment variable</in_environment_var_and_profile>
            <in_environment_var_and_java_property_and_profile>This value has been set in an environment variable</in_environment_var_and_java_property_and_profile>
            <in_app005_and_env_var>This value has been set in an environment variable</in_app005_and_env_var>
            <in_app005_and_env_var_and_property>This value has been set in an environment variable</in_app005_and_env_var_and_property>
            <encrypted_value_in_application007_and_env>cipher(PiWreyV5lSH8rqPP7/08lrLF6jCz68QnEIATISRAecef1iqzauHXgkzU9JUIumZ2hSlMyD057eDcDeGoDTRXeoTH1Ptp3nSHb41zAXXYvAE=)</encrypted_value_in_application007_and_env>                                                            
          </environmentVariables>
          <systemPropertyVariables>
            <in_common_but_overridden_by_java_property>This value has been set in a Java system property</in_common_but_overridden_by_java_property>
            <in_common_but_overridden_by_env_and_property>This value has been set in a Java system property</in_common_but_overridden_by_env_and_property>
            <encrypted_value_in_common_and_system_prop>cipher(PiWreyV5lSH8rqPP7/08lrLF6jCz68QnEIATISRAecfp8SNvfwYgtNQi1QfZS9fFvmrXfafHwm9GfV0ooPAQkw==)</encrypted_value_in_common_and_system_prop>            
            <encrypted_value_in_system_prop>cipher(PiWreyV5lSH8rqPP7/08lrLF6jCz68QnEIATISRAecfp8SNvfwYgtNQi1QfZS9fFvmrXfafHwm9GfV0ooPAQkw==)</encrypted_value_in_system_prop>
            <encrypted_value_in_env_var_and_system_prop>cipher(PiWreyV5lSH8rqPP7/08lrLF6jCz68QnEIATISRAecfp8SNvfwYgtNQi1QfZS9fFvmrXfafHwm9GfV0ooPAQkw==)</encrypted_value_in_env_var_and_system_prop>
            <in_application001_but_overridden_by_java_property>This value has been set in a Java system property</in_application001_but_overridden_by_java_property>
            <in_application001_but_overridden_by_env_and_property>This value has been set in a Java system property</in_application001_but_overridden_by_env_and_property>
            <in_system_prop>This value has been set in a Java system prop</in_system_prop>
            <in_env_var_and_system_prop>This value has been set in a Java system prop</in_env_var_and_system_prop>
            <in_java_property_and_profile>This value has been set in a Java system prop</in_java_property_and_profile>
            <in_environment_var_and_java_property_and_profile>This value has been set in a Java system prop</in_environment_var_and_java_property_and_profile>
            <in_app005_and_java_property>This value has been set in a Java system prop</in_app005_and_java_property>
            <in_app005_and_env_var_and_property>This value has been set in a Java system prop</in_app005_and_env_var_and_property>
          </systemPropertyVariables>
        </configuration>
      </plugin>
      
      <!-- JaCoCo Code Coverage -->
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>0.7.9</version>
        <executions>
          <execution>
            <id>prepare-agent</id>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
          <execution>
            <id>report</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>report</goal>
            </goals>
          </execution>
          <execution>
            <id>post-unit-test</id>
            <phase>test</phase>
            <goals>
              <goal>report</goal>
            </goals>
            <configuration>
              <outputDirectory>target/jacoco-report</outputDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
    
  <profiles>
    <profile>
      <!-- Isolating Release tasks (JavaDoc, source packaging, signing) from dev tasks -->
      <id>release</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <build>
        <plugins>
          <!-- Generate sources with artifact creation -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>3.0.1</version>
            <executions>
              <execution>
                <id>attach-sources</id>
                <phase>verify</phase>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          
          <!-- Generate JavaDoc with artifact creation -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>3.0.0-M1</version>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>        
          </plugin>
          
          <!-- GPG Signing -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.6</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          
          <!-- Deployment to OSSRH and Release to Central Repository -->
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>1.6.7</version>
            <extensions>true</extensions>
            <configuration>
              <serverId>ossrh</serverId>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
              <autoReleaseAfterClose>true</autoReleaseAfterClose>
            </configuration>
          </plugin>        
        </plugins>
      </build>
      
      <!-- OSSRH Deployment Configuration -->
      <distributionManagement>    
        <snapshotRepository>
          <id>ossrh</id>
          <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
          <id>ossrh</id>
          <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
        </repository>    
      </distributionManagement>
    </profile>
  </profiles>
</project>
