<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>

    <parent>
        <groupId>org.openmrs.maven.parents</groupId>
        <artifactId>maven-parent-openmrs-module</artifactId>
        <version>1.1.0</version>
    </parent>

    <groupId>io.github.proyecto-santaclotilde</groupId>
    <artifactId>imaging</artifactId>
    <version>1.2.2</version>
    <packaging>pom</packaging>
    <name>Imaging OpenMRS Module</name>
    <description>OpenMRS module for connecting OpenMRS with Orthanc imaging workflows.</description>

    <url>https://github.com/sihsalus/openmrs-module-imaging</url>

    <licenses>
        <license>
            <name>OpenMRS Public License 1.0</name>
            <url>https://openmrs.org/license/</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>sihsalus</id>
            <name>SIHSALUS</name>
            <organization>Proyecto Santa Clotilde</organization>
            <organizationUrl>https://github.com/sihsalus</organizationUrl>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:https://github.com/sihsalus/openmrs-module-imaging.git</connection>
        <developerConnection>scm:git:https://github.com/sihsalus/openmrs-module-imaging.git</developerConnection>
        <url>https://github.com/sihsalus/openmrs-module-imaging</url>
    </scm>

    <modules>
        <module>api</module>
        <module>omod</module>
    </modules>

    <dependencyManagement>
        <dependencies>
            <!-- Importing versions from refapp distro -->
            <dependency>
                <groupId>org.openmrs.distro</groupId>
                <artifactId>referenceapplication</artifactId>
                <version>2.13.0</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.junit</groupId>
                <artifactId>junit</artifactId>
                <version>${junitVersion}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.13.2</version>
            </dependency>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter</artifactId>
                <version>${junitVersion}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.hamcrest</groupId>
                        <artifactId>hamcrest-core</artifactId>
                    </exclusion>
                </exclusions>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.hamcrest</groupId>
                <artifactId>hamcrest-all</artifactId>
                <version>${hamcrestVersion}</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>org.openmrs.api</groupId>
                <artifactId>openmrs-api</artifactId>
                <version>${openMRSVersion}</version>
                <type>jar</type>
                <scope>provided</scope>
            </dependency>

            <dependency>
                <groupId>org.openmrs.api</groupId>
                <artifactId>openmrs-api</artifactId>
                <version>${openMRSVersion}</version>
                <type>test-jar</type>
                <scope>test</scope>
                <exclusions>
                    <exclusion>
                        <groupId>javassist</groupId>
                        <artifactId>javassist</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>

            <dependency>
                <groupId>org.openmrs.web</groupId>
                <artifactId>openmrs-web</artifactId>
                <version>${openMRSVersion}</version>
                <type>test-jar</type>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>org.openmrs.test</groupId>
                <artifactId>openmrs-test</artifactId>
                <version>${openMRSVersion}</version>
                <type>pom</type>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>org.powermock</groupId>
                <artifactId>powermock-module-junit4</artifactId>
                <version>2.0.9</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>org.powermock</groupId>
                <artifactId>powermock-api-mockito</artifactId>
                <version>1.5</version> <!-- dummy version to avoid accidental use -->
                <scope>provided</scope> <!-- or exclude entirely -->
            </dependency>
            <dependency>
                <groupId>org.powermock</groupId>
                <artifactId>powermock-api-mockito2</artifactId>
                <version>2.0.9</version>
                <scope>test</scope>
            </dependency>
       </dependencies>

    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.14.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>3.5.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>3.5.1</version>
                    <configuration>
                        <runOrder>alphabetical</runOrder>
                        <useModulePath>false</useModulePath>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.openmrs.maven.plugins</groupId>
                    <artifactId>maven-openmrs-plugin</artifactId>
                    <version>1.0.1</version>
                </plugin>
                <plugin>
                    <groupId>org.commonjava.maven.plugins</groupId>
                    <artifactId>directory-maven-plugin</artifactId>
                    <version>0.1</version>
                    <executions>
                        <execution>
                            <id>directories</id>
                            <goals>
                                <goal>highest-basedir</goal>
                            </goals>
                            <phase>validate</phase>
                            <configuration>
                                <property>main.basedir</property>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>com.mycila</groupId>
                    <artifactId>license-maven-plugin</artifactId>
                    <version>3.0</version>
                    <configuration>
                        <header>${main.basedir}${file.separator}license-header.txt</header>
                        <headerDefinitions>
                            <headerDefinition>${main.basedir}${file.separator}license-format.xml</headerDefinition>
                        </headerDefinitions>
                        <mapping>
                            <java>JAVA_STYLE</java>
                            <xml>MYXML_STYLE</xml>
                        </mapping>
                        <includes>
                            <include>**/*.java</include>
                            <include>**/*.xml</include>
                            <include>**/*.properties</include>
                        </includes>
                        <excludes>
                            <exclude>license-format.xml</exclude>
                            <exclude>**/pom.xml</exclude>
                            <exclude>**/target/**</exclude>
                            <exclude>.git/**</exclude>
                            <exclude>.idea/**</exclude>
                            <exclude>.settings/**</exclude>
                            <exclude>.externalToolBuilders/</exclude>
                            <exclude>nbproject/private/</exclude>
                            <exclude>.vscode/**</exclude>
                        </excludes>
                    </configuration>
                    <executions>
                        <execution>
                            <id>add-license</id>
                            <goals>
                                <goal>format</goal>
                            </goals>
                            <phase>validate</phase>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>net.revelc.code.formatter</groupId>
                    <artifactId>formatter-maven-plugin</artifactId>
                    <version>2.13.0</version>
                    <configuration>
                        <lineEnding>LF</lineEnding>
                        <configFile>eclipse/OpenMRSFormatter.xml</configFile>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>org.openmrs.tools</groupId>
                            <artifactId>openmrs-tools</artifactId>
                            <version>${openmrsPlatformToolsVersion}</version>
                        </dependency>
                    </dependencies>
                    <executions>
                        <execution>
                            <goals>
                                <goal>format</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>net.revelc.code</groupId>
                    <artifactId>impsort-maven-plugin</artifactId>
                    <version>1.5.0</version>
                    <dependencies>
                        <!-- Needed because of maven 3.9.0 backward compatibility issue,
                             See : https://github.com/revelc/impsort-maven-plugin/issues/64 -->
                        <dependency>
                            <groupId>org.codehaus.plexus</groupId>
                            <artifactId>plexus-utils</artifactId>
                            <version>3.5.1</version>
                        </dependency>
                    </dependencies>
                    <configuration>
                        <groups>javax, java, *</groups>
                        <removeUnused>true</removeUnused>
                    </configuration>
                    <executions>
                        <execution>
                            <goals>
                                <goal>sort</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <!-- Fix for "Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources) on project application-etude: Input length = 1" -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>3.1.0</version>
                </plugin>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>0.8.11</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>prepare-agent</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>report</id>
                            <phase>test</phase>
                            <goals>
                                <goal>report</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>3.1.2</version>
                <configuration>
                    <skip>false</skip>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>3.6.3</version>
                        <configuration>
                            <doclint>none</doclint>
                            <failOnError>false</failOnError>
                            <source>8</source>
                        </configuration>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>3.2.7</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                        <version>0.10.0</version>
                        <extensions>true</extensions>
                        <configuration>
                            <publishingServerId>central</publishingServerId>
                            <autoPublish>true</autoPublish>
                            <waitUntil>published</waitUntil>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <repositories>
        <repository>
            <id>openmrs-repo</id>
            <name>OpenMRS Nexus Repository</name>
            <url>https://mavenrepo.openmrs.org/public</url>
        </repository>
        <repository>
            <id>central</id>
            <name>Maven Repository Switchboard</name>
            <layout>default</layout>
            <url>https://repo1.maven.org/maven2</url>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>openmrs-repo</id>
            <name>OpenMRS Nexus Repository</name>
            <url>https://mavenrepo.openmrs.org/public</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>

    <properties>
        <openmrsPlatformVersion>2.5.9</openmrsPlatformVersion>
        <webservicesRestModuleVersion>2.48.0</webservicesRestModuleVersion>
        <openMRSVersion>2.5.9</openMRSVersion>
        <junitVersion>4.13.2</junitVersion>
        <hamcrestVersion>3.0</hamcrestVersion>
<!--        <mockitoVersion>2.23.4</mockitoVersion>-->
    </properties>
</project>
