<?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>org.bahmni.module</groupId>
    <artifactId>bahmni-commons</artifactId>
    <packaging>pom</packaging>
    <version>1.2.0</version>
    <name>Bahmni Commons Module</name>
    <description>This module has extracted APIs from Bahmni Core, which are being used by bahmni appointments module.</description>
    <url>https://demo.mybahmni.org/bahmni/home/index.html</url>
    <licenses>
        <license>
            <name>GNU AFFERO GENERAL PUBLIC LICENSE</name>
            <url>https://www.gnu.org/licenses/agpl-3.0.txt</url>
        </license>
    </licenses>
    <developers>
        <developer>
            <name>Bahmnitw</name>
            <email>bahmnicommunity@gmail.com</email>
            <organization>Bahmni</organization>
            <organizationUrl>https://github.com/Bahmni</organizationUrl>
        </developer>
    </developers>
    <scm>
        <connection>scm:git:git://github.com/bahmni/openmrs-module-bahmnicommons.git</connection>
        <developerConnection>scm:git:https://github.com/Bahmni/openmrs-module-bahmnicommons.git</developerConnection>
        <url>https://github.com/Bahmni/openmrs-module-bahmnicommons</url>
    </scm>
    <modules>
        <module>bahmni-commons-omod</module>
        <module>bahmni-commons-api</module>
    </modules>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <openMRSVersion>2.5.7</openMRSVersion>
        <openMRSWebServicesVersion>2.29.0</openMRSWebServicesVersion>
        <springVersion>5.2.14.RELEASE</springVersion>
        <addressHierarchyVersion>2.14.2</addressHierarchyVersion>
        <reportingModuleVersion>1.23.0</reportingModuleVersion>
        <calculationModuleVersion>1.3.0</calculationModuleVersion>
        <serializationXstreamModuleVersion>0.2.15</serializationXstreamModuleVersion>
        <lombokVersion>1.16.0</lombokVersion>
        <idgenVersion>4.7.0</idgenVersion>
        <javaxMail.version>1.6.2</javaxMail.version>
        <!--test dependencies-->
        <junitVersion>4.13</junitVersion>
        <powerMockVersion>2.0.7</powerMockVersion>
        <hamcrestVersion>1.3</hamcrestVersion>
        <mockitoVersion>3.12.4</mockitoVersion>
        <argLine>-Xmx1024m</argLine>
        <jacocoVersion>0.8.8</jacocoVersion>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.openmrs.api</groupId>
                <artifactId>openmrs-api</artifactId>
                <version>${openMRSVersion}</version>
                <type>jar</type>
                <scope>provided</scope>
                <exclusions>
                    <exclusion>
                        <groupId>javax.servlet</groupId>
                        <artifactId>servlet-api</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.openmrs.web</groupId>
                <artifactId>openmrs-web</artifactId>
                <version>${openMRSVersion}</version>
                <type>jar</type>
                <exclusions>
                    <exclusion>
                        <groupId>javax.servlet</groupId>
                        <artifactId>servlet-api</artifactId>
                    </exclusion>
                </exclusions>
                <scope>provided</scope>
            </dependency>

            <!--webservices.rest main module-->
            <dependency>
                <groupId>org.openmrs.module</groupId>
                <artifactId>webservices.rest-omod</artifactId>
                <version>${openMRSWebServicesVersion}</version>
                <type>jar</type>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.openmrs.module</groupId>
                <artifactId>webservices.rest-omod-common</artifactId>
                <version>${openMRSWebServicesVersion}</version>
                <type>jar</type>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>javax.servlet</groupId>
                <artifactId>javax.servlet-api</artifactId>
                <version>3.0.1</version>
                <scope>provided</scope>
            </dependency>

            <!--test dependencies-->
            <dependency>
                <groupId>org.openmrs.web</groupId>
                <artifactId>openmrs-web</artifactId>
                <version>${openMRSVersion}</version>
                <type>test-jar</type>
                <scope>test</scope>
                <exclusions>
                    <exclusion>
                        <groupId>javax.servlet</groupId>
                        <artifactId>servlet-api</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.openmrs.test</groupId>
                <artifactId>openmrs-test</artifactId>
                <version>${openMRSVersion}</version>
                <type>pom</type>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${junitVersion}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.hamcrest</groupId>
                        <artifactId>hamcrest-core</artifactId>
                    </exclusion>
                </exclusions>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>${mockitoVersion}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.hamcrest</groupId>
                        <artifactId>hamcrest-core</artifactId>
                    </exclusion>
                </exclusions>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.powermock</groupId>
                <artifactId>powermock-api-mockito2</artifactId>
                <version>${powerMockVersion}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.powermock</groupId>
                <artifactId>powermock-module-junit4</artifactId>
                <version>${powerMockVersion}</version>
                <scope>test</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>javax.servlet</groupId>
                        <artifactId>servlet-api</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.hamcrest</groupId>
                <artifactId>hamcrest-all</artifactId>
                <version>${hamcrestVersion}</version>
                <scope>test</scope>
            </dependency>


        </dependencies>


    </dependencyManagement>

    <build>
        <plugins>
            <plugin>
                <groupId>org.sonatype.central</groupId>
                <artifactId>central-publishing-maven-plugin</artifactId>
                <version>0.7.0</version>
                <extensions>true</extensions>
                <configuration>
                    <publishingServerId>nexus-sonatype</publishingServerId>
                </configuration>
            </plugin>
        </plugins>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <configuration>
                        <target>1.8</target>
                        <source>1.8</source>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.openmrs.maven.plugins</groupId>
                    <artifactId>maven-openmrs-plugin</artifactId>
                    <version>1.0.1</version>
                    <extensions>true</extensions>
                    <executions>
                        <execution>
                            <id>pack</id>
                            <phase>package</phase>
                            <goals>
                                <goal>package-module</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.2.0</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>test-jar</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>${jacocoVersion}</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>prepare-agent</goal>
                            </goals>
                            <configuration>
                                <includes>
                                    <include>**/*</include>
                                </includes>
                                <excludes>
                                    <exclude>**/*Activator.class</exclude>
                                </excludes>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.10</version>
                    <configuration>
                        <includes>
                            <include>**/*Test.java</include>
                        </includes>
                        <excludes>
                            <exclude>**/BaseIntegrationTest.java</exclude>
                        </excludes>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        <profile>
            <id>IT</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <version>2.17</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>integration-test</goal>
                                    <goal>verify</goal>
                                </goals>
                                <configuration>
                                    <argLine>-Xmx512m</argLine>
                                    <includes>
                                        <include>**/*IT.java</include>
                                    </includes>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>release-sign-artifacts</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>3.2.1</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>3.2.0</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <configuration>
						<!-- Prevent gpg from using pinentry programs -->
							<gpgArguments>
								<arg>--pinentry-mode</arg>
								<arg>loopback</arg>
							</gpgArguments>
						</configuration>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <repositories>
        <repository>
            <id>sonatype-nexus-snapshots</id>
            <name>Sonatype Nexus Snapshots</name>
            <url>https://central.sonatype.com/repository/maven-snapshots</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
                <updatePolicy>interval:10080</updatePolicy>
            </snapshots>
        </repository>
        <repository>
            <id>central</id>
            <url>https://repo1.maven.org/maven2</url>
            <name>Repository for dependencies</name>
            <snapshots>
                <enabled>true</enabled>
                <updatePolicy>interval:10080</updatePolicy>
            </snapshots>
        </repository>
        <repository>
            <id>spring-maven-release</id>
            <name>Spring Maven Release Repository</name>
            <url>https://maven.springframework.org/release</url>
            <releases>
                <updatePolicy>interval:10080</updatePolicy>
            </releases>
        </repository>
        <repository>
            <id>apache-maven-release</id>
            <name>Apache Maven Release Repository</name>
            <url>https://repository.apache.org/content/repositories/releases</url>
            <releases>
                <updatePolicy>interval:10080</updatePolicy>
            </releases>
        </repository>
        <repository>
            <id>JBoss</id>
            <name>The "public-jboss" repository group provides a combined view all JBoss community project artifacts
            </name>
            <layout>default</layout>
            <url>https://repository.jboss.org/nexus/content/groups/public-jboss</url>
            <releases>
                <updatePolicy>interval:10080</updatePolicy>
            </releases>
        </repository>
        <repository>
            <id>spring-repo</id>
            <name>Spring Maven Repository</name>
            <url>https://maven.springframework.org/milestone</url>
            <releases>
                <updatePolicy>interval:10080</updatePolicy>
            </releases>
            <snapshots>
                <updatePolicy>interval:10080</updatePolicy>
            </snapshots>
        </repository>
        <repository>
            <id>openmrs-repo</id>
            <name>OpenMRS Nexus Repository</name>
            <url>https://mavenrepo.openmrs.org/nexus/content/repositories/public</url>
            <releases>
                <updatePolicy>always</updatePolicy>
            </releases>
        </repository>
        <repository>
            <id>repo.mybahmni.org</id>
            <name>bahmni-artifactory-snapshots</name>
            <url>https://repo.mybahmni.org.s3.amazonaws.com/artifactory/snapshot</url>
            <snapshots>
                <updatePolicy>always</updatePolicy>
            </snapshots>
        </repository>
        <repository>
            <id>repo.mybahmni.org-release</id>
            <name>bahmni-artifactory-release</name>
            <url>https://repo.mybahmni.org.s3.amazonaws.com/artifactory/release</url>
        </repository>
        <repository>
            <id>rubygems-releases</id>
            <url>https://rubygems-proxy.torquebox.org/releases</url>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>central</id>
            <url>https://repo1.maven.org/maven2</url>
            <name>Repository for plugins</name>
        </pluginRepository>
        <pluginRepository>
            <id>spring-maven-release</id>
            <name>Spring Maven Release Repository</name>
            <url>https://maven.springframework.org/release</url>
        </pluginRepository>
        <pluginRepository>
            <id>spring-maven-milestone</id>
            <name>Spring Maven Milestone Repository</name>
            <url>https://maven.springframework.org/milestone</url>
        </pluginRepository>
        <pluginRepository>
            <id>openmrs-repo</id>
            <name>OpenMRS Nexus Repository</name>
            <url>https://mavenrepo.openmrs.org/nexus/content/repositories/public</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>

</project>
