<?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">
    <properties>
        <!--- Dependency versions -->
        <mjson.version>1.4.1</mjson.version>
        <openlrae.version>2.3</openlrae.version>
        <!--- Dependency for testing -->
        <junit-jupiter-engine.version>5.8.2</junit-jupiter-engine.version>
        <!-- Maven plugins versions -->
        <maven.compiler.plugin.version>3.8.1</maven.compiler.plugin.version>
        <maven.enforcer.plugin.version>3.0.0-M3</maven.enforcer.plugin.version>
        <maven.jar.plugin.version>3.2.0</maven.jar.plugin.version>
        <maven.javadoc.plugin.version>3.1.1</maven.javadoc.plugin.version>
        <maven.surefire.plugin.version>3.0.0-M4</maven.surefire.plugin.version>
        <maven.source.plugin.version>3.2.1</maven.source.plugin.version>
        <maven.plugin.api.version>3.8.4</maven.plugin.api.version>
        <maven.plugin.annotations.version>3.6.4</maven.plugin.annotations.version>
        <maven.plugin.plugin.version>3.6.0</maven.plugin.plugin.version>
        <jacoco.maven.plugin.version>0.8.7</jacoco.maven.plugin.version>
        <openlrae.maven.plugin>2.2</openlrae.maven.plugin>
        <!--- Build parameters -->
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.release>9</maven.compiler.release> 
        <!-- About this version of OpenLRAE Maven Plugin (used for properties filtering) -->
        <openlrae-maven-plugin.license>Apache-2.0</openlrae-maven-plugin.license>
        <openlrae-maven-plugin.version>2.3</openlrae-maven-plugin.version>
    </properties>
    
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.manolodominguez</groupId>
    <artifactId>openlrae-maven-plugin</artifactId>
    <version>2.3</version>
    <packaging>maven-plugin</packaging>
    <name>OpenLRAE Maven Plugin</name>
    <description>OpenLRAE Maven Plugin is a maven plugin designed to allow an easy control of licensing risks taking advantage of OpenLRAE java library. It is opensource, multilanguaje and multiplatform.</description>
    <url>http://openlrae-maven-plugin.manolodominguez.com/</url>
    <licenses>
        <license>
            <name>${openlrae-maven-plugin.license}</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>    
    <developers>
        <developer>
            <name>Manuel Domínguez Dorado</name>
            <email>ingeniero@ManoloDominguez.com</email>
            <organization>Manuel Domínguez Dorado</organization>
            <organizationUrl>https://manolodominguez.com</organizationUrl>
        </developer>
    </developers>
    <scm>
        <connection>scm:git:git://github.com/manolodd/openlrae-maven-plugin.git</connection>
        <developerConnection>scm:git:ssh://github.com:manolodd/openlrae-maven-plugin.git</developerConnection>
        <url>http://github.com/manolodd/openlrae-maven-plugin/tree/master</url>
    </scm>    
    <build>
        <finalName>openlrae-maven-plugin-${project.version}</finalName>
        <plugins>         
            <plugin>
                <groupId>com.manolodominguez</groupId>
                <artifactId>openlrae-maven-plugin</artifactId>
                <version>${openlrae.maven.plugin}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>analyse</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <riskThresholds>
                        <HAVING_COMPONENTS_LICENSES_INCOMPATIBLE_WITH_PROJECT_LICENSES>0.0</HAVING_COMPONENTS_LICENSES_INCOMPATIBLE_WITH_PROJECT_LICENSES>
                    </riskThresholds>
                    <showReport>true</showReport>
                </configuration>
            </plugin>            
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-plugin-plugin</artifactId>
                <version>${maven.plugin.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>
                    <!-- attached to Maven test phase -->
                    <execution>
                        <id>report</id>
                        <phase>test</phase>
                        <goals>
                            <goal>report</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>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>            
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>${maven.jar.plugin.version}</version>
            </plugin>            
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven.compiler.plugin.version}</version>
                <configuration>
                    <compilerArgs>
                        <arg>-Xlint:all,-options,-path</arg>
                    </compilerArgs>
                    <excludes>
                        <exclude>**/*.png</exclude>
                        <exclude>**/*.jpg</exclude>
                        <exclude>**/*.xcf</exclude>
                    </excludes>                </configuration>
            </plugin>     
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${maven.javadoc.plugin.version}</version>                
                <configuration>
                    <detectJavaApiLink>false</detectJavaApiLink>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</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-maven</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireMavenVersion>
                                    <version>3.3.9</version>
                                </requireMavenVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>            
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven.surefire.plugin.version}</version>       
            </plugin>
        </plugins>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>            
            </resource>
        </resources>    
 
    </build>

    <dependencies>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>${junit-jupiter-engine.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.sharegov</groupId>
            <artifactId>mjson</artifactId>
            <version>${mjson.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>junit</groupId>
                    <artifactId>junit</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.manolodominguez</groupId>
            <artifactId>openlrae</artifactId>
            <version>${openlrae.version}</version>
        </dependency>    
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-plugin-api</artifactId>
            <version>${maven.plugin.api.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.plugin-tools</groupId>
            <artifactId>maven-plugin-annotations</artifactId>
            <version>${maven.plugin.annotations.version}</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
</project>
