<?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>
  <groupId>com.kasisoft</groupId>
  <artifactId>com.kasisoft.libs.plex</artifactId>
  <version>0.2</version>

  <name>PLEX :: Excel library</name>
  <url>https://kasisoft.com/project/plex/</url>
  <description>Library helping to extract data from Excel files.</description>
  
  <licenses>
    <license>
      <name>MIT License</name>
      <url>https://choosealicense.com/licenses/mit</url>
    </license>
  </licenses>
  
  <organization>
    <name>Kasisoft</name>
    <url>https://kasisoft.com</url>
  </organization>
  
  <scm>
    <url>https://kasisoft.com/project/plex/</url>
    <connection>scm:git:https://github.com/kasisoft/plex.git</connection>
    <developerConnection>scm:git:https://github.com/kasisoft/plex.git</developerConnection>
  </scm>
  
  <issueManagement>
    <system>github</system>
    <url>https://github.com/kasisoft/plex/issues</url>
  </issueManagement>
  
  <ciManagement>
    <system>github</system>
    <url>https://github.com/kasisoft/plex/actions</url>
  </ciManagement>
  
  <developers>
    <developer>
      <id>costamojan</id>
      <name>Daniel Kasmeroglu</name>
      <email>daniel.kasmeroglu@kasisoft.com</email>
    </developer>
  </developers>
  
  <properties>
  
    <java.version>8</java.version>
  
    <!-- versioning: dependencies -->
    <hamcrest.version>1.3</hamcrest.version>
    <jakarta.validation-api.version>2.0.2</jakarta.validation-api.version>
    <jaxb-api.version>2.3.1</jaxb-api.version>
    <jaxb-impl.version>2.3.3</jaxb-impl.version>
    <kcl.version>2.9</kcl.version>
    <lombok.version>1.18.12</lombok.version>
    <poi.version>3.17</poi.version>
    <testng.version>7.3.0</testng.version>
    
    <!-- versioning: plugins -->
    <build-helper-maven-plugin.version>3.2.0</build-helper-maven-plugin.version>
    <jacoco-maven-plugin.version>0.8.5</jacoco-maven-plugin.version>
    <jaxb-maven-plugin.version>0.8.5</jaxb-maven-plugin.version>
    <maven-bundle-plugin.version>5.1.1</maven-bundle-plugin.version>
    <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
    <maven-deploy-plugin.version>3.0.0-M1</maven-deploy-plugin.version>
    <maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
    <maven-jar-plugin.version>3.2.0</maven-jar-plugin.version>
    <maven-javadoc-plugin.version>3.2.0</maven-javadoc-plugin.version>
    <maven-release-plugin.version>3.0.0-M1</maven-release-plugin.version>
    <maven-source-plugin.version>3.2.1</maven-source-plugin.version>
    <maven-surefire-plugin.version>3.0.0-M5</maven-surefire-plugin.version>
    <nexus-staging-maven-plugin.version>1.6.8</nexus-staging-maven-plugin.version>
    
    <!-- maven settings -->
    <maven.compiler.source>${java.version}</maven.compiler.source>
    <maven.compiler.target>${java.version}</maven.compiler.target>
    <maven.javadoc.failOnError>false</maven.javadoc.failOnError>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    
  </properties>
  
  <dependencyManagement>
    <dependencies>
    
      <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
        <version>${lombok.version}</version>
        <scope>provided</scope>
      </dependency>
      
      <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi</artifactId>
        <version>${poi.version}</version>
      </dependency>
      
      <dependency>
        <groupId>jakarta.validation</groupId>
        <artifactId>jakarta.validation-api</artifactId>
        <version>${jakarta.validation-api.version}</version>
      </dependency>
      
      <dependency>
        <groupId>com.kasisoft</groupId>
        <artifactId>com.kasisoft.libs.common</artifactId>
        <version>${kcl.version}</version>
      </dependency>
      
      <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi-ooxml</artifactId>
        <version>${poi.version}</version>
      </dependency>
      
      <dependency>
        <groupId>javax.xml.bind</groupId>
        <artifactId>jaxb-api</artifactId>
        <version>${jaxb-api.version}</version>
      </dependency>
      
      <dependency>
        <groupId>com.sun.xml.bind</groupId>
        <artifactId>jaxb-impl</artifactId>
        <version>${jaxb-impl.version}</version>
      </dependency>

      <dependency>
        <groupId>com.sun.xml.bind</groupId>
        <artifactId>jaxb-xjc</artifactId>
        <version>${jaxb-impl.version}</version>
      </dependency>
      
      <dependency>
        <groupId>org.testng</groupId>
        <artifactId>testng</artifactId>
        <version>${testng.version}</version>
        <scope>test</scope>
      </dependency>
      
      <dependency>
        <groupId>org.hamcrest</groupId>
        <artifactId>hamcrest-all</artifactId>
        <version>${hamcrest.version}</version>
        <scope>test</scope>
      </dependency>
      
    </dependencies>
  </dependencyManagement>
  
  <dependencies>
  
    <dependency>
      <groupId>org.projectlombok</groupId>
      <artifactId>lombok</artifactId>
    </dependency>
  
    <dependency>
      <groupId>jakarta.validation</groupId>
      <artifactId>jakarta.validation-api</artifactId>
    </dependency>

    <dependency>
      <groupId>com.kasisoft</groupId>
      <artifactId>com.kasisoft.libs.common</artifactId>
    </dependency>

    <dependency>
      <groupId>org.apache.poi</groupId>
      <artifactId>poi</artifactId>
    </dependency>

    <dependency>
      <groupId>org.apache.poi</groupId>
      <artifactId>poi-ooxml</artifactId>
    </dependency>
  
    <dependency>
      <groupId>org.testng</groupId>
      <artifactId>testng</artifactId>
    </dependency>
  
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-all</artifactId>
    </dependency>
    
    <dependency>
      <groupId>javax.xml.bind</groupId>
      <artifactId>jaxb-api</artifactId>
    </dependency>
    
    <dependency>
      <groupId>com.sun.xml.bind</groupId>
      <artifactId>jaxb-impl</artifactId>
    </dependency>

    <dependency>
      <groupId>com.sun.xml.bind</groupId>
      <artifactId>jaxb-xjc</artifactId>
    </dependency>

  </dependencies>

  <build>
  
    <finalName>${project.artifactId}-${project.version}</finalName>
    
    <pluginManagement>
      <plugins>

        <plugin>
          <groupId>org.openjax.jaxb</groupId>
          <artifactId>jaxb-maven-plugin</artifactId>
          <version>${jaxb-maven-plugin.version}</version>
          <executions>
            <execution>
              <id>xjc</id>
              <goals>
                <goal>xjc</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <bindings>
              <binding>src/main/resources/plex.jxb</binding>
            </bindings>
            <schemas>
              <schema>src/main/resources/plex.xsd</schema>
            </schemas>
            <noGeneratedHeaderComments>true</noGeneratedHeaderComments>
            <noHeader>true</noHeader>
            <packageName>com.kasisoft.libs.plex.model</packageName>
            <destDir>src/main/generated</destDir>
          </configuration>
        </plugin>
  
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>build-helper-maven-plugin</artifactId>
          <version>${build-helper-maven-plugin.version}</version>
          <executions>
            <execution>
              <id>add-source</id>
              <phase>generate-sources</phase>
              <goals>
                <goal>add-source</goal> 
              </goals>
              <configuration>
                <sources>
                  <source>src/main/generated</source>
                </sources>
              </configuration>
            </execution>
          </executions>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-gpg-plugin</artifactId>
          <version>${maven-gpg-plugin.version}</version>
        </plugin>

        <plugin> 
          <groupId>org.apache.felix</groupId> 
          <artifactId>maven-bundle-plugin</artifactId>
          <version>${maven-bundle-plugin.version}</version>
          <extensions>true</extensions> 
          <configuration> 
            <instructions> 
              <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName> 
              <Bundle-Version>${project.version}</Bundle-Version> 
            </instructions> 
          </configuration> 
          <executions>
            <execution>
              <id>generate-manifest</id>
              <phase>compile</phase>
              <goals>
                <goal>manifest</goal>
              </goals>
            </execution>
          </executions>
        </plugin> 
      
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>${maven-source-plugin.version}</version>
          <executions>
            <execution>
              <id>attach-sources</id>
              <phase>verify</phase>
              <goals>
                <goal>jar-no-fork</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>${maven-deploy-plugin.version}</version>
        </plugin>
        
        <plugin>
          <groupId>org.jacoco</groupId>
          <artifactId>jacoco-maven-plugin</artifactId>
          <version>${jacoco-maven-plugin.version}</version>
          <executions>
            <execution>
              <goals>
                <goal>prepare-agent</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <haltOnFailure>false</haltOnFailure>
            <excludes>
              <exclude>**/*Test.class</exclude>
            </excludes>
          </configuration>
        </plugin>
        
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>${maven-compiler-plugin.version}</version>
          <configuration>
            <showWarnings>true</showWarnings>
            <parameters>true</parameters>
            <annotationProcessorPaths>
              <annotationProcessorPath>
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok</artifactId>
                <version>${lombok.version}</version>
              </annotationProcessorPath>
            </annotationProcessorPaths>
          </configuration>
        </plugin>
        
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>${maven-javadoc-plugin.version}</version>
          <executions>
            <execution>
              <id>attach-javadocs</id>
              <goals>
                <goal>jar</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <failOnError>false</failOnError>
            <additionalparam>-Xdoclint:none</additionalparam>
          </configuration>
        </plugin>
        
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>${maven-jar-plugin.version}</version>
          <configuration>
            <archive>
              <addMavenDescriptor>false</addMavenDescriptor>
            </archive>
          </configuration>
        </plugin>
        
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>${maven-surefire-plugin.version}</version>
          <configuration>
            <properties>
              <property>
                <name>usedefaultlisteners</name>
                <key>false</key>
              </property>
            </properties>
          </configuration>
        </plugin>
        
      </plugins>
    </pluginManagement>
    
    <plugins>
    
      <plugin> 
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
      </plugin> 
      
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>build-helper-maven-plugin</artifactId>
          </plugin>
      
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
      </plugin>
      
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
      </plugin>
      
    </plugins>
    
  </build>
  
  <profiles>
    <profile>
      <id>release-sign-artifacts</id>
      <activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>
      <build>
        <plugins>
        
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>${nexus-staging-maven-plugin.version}</version>
            <extensions>true</extensions>
            <configuration>
              <serverId>sonatype-nexus-staging</serverId>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
              <autoReleaseAfterClose>true</autoReleaseAfterClose>
            </configuration>
          </plugin>
          
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-release-plugin</artifactId>
            <version>${maven-release-plugin.version}</version>
            <configuration>
              <!-- [MRELEASE-263] -->
              <mavenExecutorId>forked-path</mavenExecutorId>
            </configuration>
          </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>
          
        </plugins>
      </build>
    </profile>
  </profiles>
  
  <distributionManagement>
    <snapshotRepository>
      <id>github</id>
      <url>https://maven.pkg.github.com/kasisoft/plex</url>
    </snapshotRepository>
  </distributionManagement>
  
  <repositories>
    <repository>
       <id>github-plex</id>
       <url>https://maven.pkg.github.com/kasisoft/plex</url>
       <releases>
         <enabled>false</enabled>
       </releases>
       <snapshots>
         <enabled>true</enabled>
       </snapshots>
     </repository>
  </repositories>
  
</project>
