<?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/maven-v4_0_0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<groupId>io.github.abdi-icap</groupId>
	<artifactId>reporting</artifactId>
	<version>2.2.1</version>
	<packaging>pom</packaging>
	<name>Reporting</name>
	<description>Parent project for Reporting</description>

	<url>${nexus.url}/repository/maven-snapshots/</url>
	<organization>
		<name>ICAP At Columbia Unversity</name>
	</organization>
	<developers>
		<developer>
			<name>Samuel Ababeye and Abdi Asres</name>
		</developer>
	</developers>

	<licenses>
		<license>
			<name>Apache 2</name>
			<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
			<distribution>repo</distribution>
		</license>
	</licenses>
	<scm>
		<connection>scm:git:git@github.com:openmrs/openmrs-module-reporting.git</connection>
		<developerConnection>scm:git:git@github.com:openmrs/openmrs-module-reporting.git</developerConnection>
		<url>https://github.com/openmrs/openmrs-module-reporting/</url>
        <tag>HEAD</tag>
    </scm>

	<modules>
		<module>api</module>
		<module>api-tests</module>
		<module>omod</module>
    </modules>

	<properties>
		<openMRSVersion>2.7.0</openMRSVersion>
		<openMRSMinorVersion>2.7</openMRSMinorVersion>
		<htmlwidgetsVersion>2.0.1</htmlwidgetsVersion>
		<serializationVersion>0.3.0</serializationVersion>
		<calculationVersion>1.2</calculationVersion>
		<quartzVersion>2.1.1</quartzVersion>
		<poiVersion>3.12</poiVersion>
		<jodatimeVersion>2.12.5</jodatimeVersion>
		<handlebarsVersion>1.1.2</handlebarsVersion>
		<openmrsTestutilsVersion>1.7.0</openmrsTestutilsVersion>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<MODULE_ID>${project.parent.artifactId}</MODULE_ID>
		<MODULE_NAME>Reporting</MODULE_NAME>
		<MODULE_VERSION>${project.parent.version}</MODULE_VERSION>
		<MODULE_PACKAGE>org.openmrs.module.reporting</MODULE_PACKAGE>
		<nexus.url>https://maven-repo.dh.moh.gov.et</nexus.url>
	</properties>

<!--	<distributionManagement>-->
<!--		<repository>-->
<!--			<id>nexus-releases</id>-->
<!--			<url>${nexus.url}/repository/maven-releases/</url>-->
<!--		</repository>-->
<!--		<snapshotRepository>-->
<!--			<id>nexus-snapshots</id>-->
<!--			<url>${nexus.url}/repository/maven-snapshots/</url>-->
<!--		</snapshotRepository>-->
<!--	</distributionManagement>-->

	<dependencies>

		<dependency>
			<groupId>org.apache.poi</groupId>
			<artifactId>poi</artifactId>
			<version>${poiVersion}</version>
			<exclusions>
				<exclusion>
					<groupId>log4j</groupId>
					<artifactId>log4j</artifactId>
				</exclusion>
				<exclusion>
					<groupId>commons-logging</groupId>
					<artifactId>commons-logging</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

		<dependency>
			<groupId>mysql</groupId>
			<artifactId>mysql-connector-java</artifactId>
			<version>5.1.28</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.quartz-scheduler</groupId>
			<artifactId>quartz</artifactId>
			<version>${quartzVersion}</version>
			<scope>compile</scope>
			<exclusions>
				<exclusion>
					<groupId>org.slf4j</groupId>
					<artifactId>slf4j-api</artifactId>
				</exclusion>
				<exclusion>
					<groupId>c3p0</groupId>
					<artifactId>c3p0</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

        <dependency>
            <groupId>joda-time</groupId>
            <artifactId>joda-time</artifactId>
            <version>${jodatimeVersion}</version>
        </dependency>

        <dependency>
            <groupId>com.github.jknack</groupId>
            <artifactId>handlebars</artifactId>
            <version>${handlebarsVersion}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.openmrs.contrib</groupId>
            <artifactId>testutils</artifactId>
            <version>${openmrsTestutilsVersion}</version>
            <scope>test</scope>
        </dependency>

		<!-- Needed to be able to build using PowerMock on Java 8. See http://stackoverflow.com/a/33162314 -->
		<dependency>
			<groupId>org.javassist</groupId>
			<artifactId>javassist</artifactId>
			<version>3.19.0-GA</version>
			<scope>test</scope>
		</dependency>

		<!-- OpenMRS dependencies -->
		<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>jar</type>
			<scope>test</scope>
			<classifier>tests</classifier>
		</dependency>

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

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

		<dependency>
			<groupId>org.openmrs.test</groupId>
			<artifactId>openmrs-test</artifactId>
			<version>${openMRSVersion}</version>
			<type>pom</type>
			<scope>test</scope>
			<exclusions>
				<exclusion>
					<groupId>com.h2database</groupId>
					<artifactId>h2</artifactId>
				</exclusion>
				<exclusion>
					<groupId>org.hsqldb</groupId>
					<artifactId>hsqldb</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

		<dependency>
			<groupId>com.h2database</groupId>
			<artifactId>h2</artifactId>
			<version>1.3.173</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.openmrs.module</groupId>
			<artifactId>serialization.xstream-api</artifactId>
			<version>${serializationVersion}</version>
			<scope>provided</scope>
		</dependency>

		<dependency>
			<groupId>org.openmrs.module</groupId>
			<artifactId>htmlwidgets-api</artifactId>
			<version>${htmlwidgetsVersion}</version>
			<scope>provided</scope>
		</dependency>

		<dependency>
			<groupId>org.openmrs.module</groupId>
			<artifactId>htmlwidgets-omod</artifactId>
			<version>${htmlwidgetsVersion}</version>
			<scope>provided</scope>
		</dependency>

		<dependency>
			<groupId>javax.mail</groupId>
			<artifactId>mail</artifactId>
			<version>1.3.2</version>
			<scope>provided</scope>
		</dependency>

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

		<dependency>
    		<groupId>org.owasp.encoder</groupId>
    		<artifactId>encoder</artifactId>
    		<version>1.2.3</version>
		</dependency>

        <!-- For reading YAML and JSON files -->
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
            <version>2.9.8</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>2.9.10.8</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.dataformat</groupId>
            <artifactId>jackson-dataformat-yaml</artifactId>
            <version>2.9.8</version>
        </dependency>

		<dependency>
			<groupId>org.apache.poi</groupId>
			<artifactId>poi-ooxml</artifactId>
			<version>${poiVersion}</version>
			<exclusions>
                <exclusion>
                    <groupId>xml-apis</groupId>
                    <artifactId>xml-apis</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>stax</groupId>
                    <artifactId>stax-api</artifactId>
                </exclusion>
				<exclusion>
					<groupId>dom4j</groupId>
					<artifactId>dom4j</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
	</dependencies>
	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>io.github.abdi-icap</groupId>
				<artifactId>reporting-api</artifactId>
				<version>${project.version}</version>
			</dependency>
		</dependencies>
	</dependencyManagement>
	<build>
		<resources>
			<resource>
				<directory>src/main/resources</directory>
				<filtering>false</filtering>
				<excludes>
					<exclude>**/*.xml</exclude>
					<exclude>**/*.properties</exclude>
				</excludes>
			</resource>
			<resource>
				<directory>src/main/resources</directory>
				<filtering>true</filtering>
				<includes>
					<include>**/*.xml</include>
					<include>**/*.properties</include>
				</includes>
			</resource>
		</resources>
		<testResources>
			<testResource>
				<directory>src/test/resources</directory>
				<filtering>false</filtering>
				<excludes>
					<exclude>**/*.xml</exclude>
					<exclude>**/*.properties</exclude>
				</excludes>
			</testResource>
			<testResource>
				<directory>src/test/resources</directory>
				<filtering>true</filtering>
				<includes>
					<include>**/*.xml</include>
					<include>**/*.properties</include>
				</includes>
			</testResource>
		</testResources>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-gpg-plugin</artifactId>
				<version>3.2.4</version>
				<executions>
					<execution>
						<id>sign-artifacts</id>
						<phase>verify</phase>
						<goals>
							<goal>sign</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<bestPractices>true</bestPractices>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
				<version>3.3.1</version>
				<executions>
					<execution>
						<id>attach-sources</id>
						<goals>
							<goal>jar-no-fork</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.sonatype.central</groupId>
				<artifactId>central-publishing-maven-plugin</artifactId>
				<version>0.6.0</version>
				<extensions>true</extensions>
				<configuration>
					<publishingServerId>central</publishingServerId>
					<autoPublish>true</autoPublish>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<version>3.6.3</version>
				<executions>
					<execution>
						<id>attach-javadocs</id>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<failOnError>false</failOnError>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<version>1.7</version>
				<executions>
					<execution>
						<phase>generate-test-resources</phase>
						<goals>
							<goal>parse-version</goal>
						</goals>
						<configuration>
							<propertyPrefix>omrsVersion</propertyPrefix>
							<versionString>${openMRSVersion}</versionString>
						</configuration>
					</execution>
				</executions>
			</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.apache.maven.plugins</groupId>
					<artifactId>maven-resources-plugin</artifactId>
					<configuration>
						<includeEmptyDirs>true</includeEmptyDirs>
					</configuration>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-surefire-plugin</artifactId>
					<version>3.5.3</version>
					<configuration>
						<!-- Some tests are locale specific -->
                        <argLine>-Xmx1024m -Xms1024m -Duser.language=en -Duser.region=US -Djdk.net.URLClassPath.disableClassPathURLCheck=true</argLine>
						<!-- Bamboo agents require a different tmp folder -->
						<systemPropertyVariables>
							<java.io.tmpdir>${java.io.tmpdir}</java.io.tmpdir>
						</systemPropertyVariables>
					</configuration>
				</plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <executions>
                        <execution>
                            <goals>
                                <goal>test-jar</goal>
                            </goals>
                        </execution>
                    </executions>
					<configuration>
						<excludes>
							<exclude>TestingApplicationContext.xml</exclude>
						</excludes>
					</configuration>
                </plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-release-plugin</artifactId>
					<version>2.5</version>
					<configuration>
						<autoVersionSubmodules>true</autoVersionSubmodules>
						<tagNameFormat>@{project.version}</tagNameFormat>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-javadoc-plugin</artifactId>
					<version>3.11.2</version>
					<configuration>
						<additionalJOption>-Xdoclint:none</additionalJOption>
					</configuration>
					<executions>
						<execution>
							<id>attach-javadocs</id>
							<goals>
								<goal>jar</goal>
							</goals>
						</execution>
					</executions>
				</plugin>

				<plugin>
					<groupId>org.openmrs.maven.plugins</groupId>
					<artifactId>maven-openmrs-plugin</artifactId>
					<version>1.0.1</version>
					<extensions>true</extensions>
					<executions>
						<execution>
							<id>init</id>
							<phase>initialize</phase>
							<goals>
								<goal>initialize-module</goal>
							</goals>
						</execution>
						<execution>
							<id>pack</id>
							<phase>package</phase>
							<goals>
								<goal>package-module</goal>
							</goals>
						</execution>
					</executions>
				</plugin>

				<!--This plugin's configuration is used to store Eclipse m2e settings
					only. It has no influence on the Maven build itself. -->
				<plugin>
					<groupId>org.eclipse.m2e</groupId>
					<artifactId>lifecycle-mapping</artifactId>
					<version>1.0.0</version>
					<configuration>
						<lifecycleMappingMetadata>
							<pluginExecutions>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>
											org.openmrs.maven.plugins
										</groupId>
										<artifactId>
											maven-openmrs-plugin
										</artifactId>
										<versionRange>
											[1.0.1,)
										</versionRange>
										<goals>
											<goal>
												initialize-module
											</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore />
									</action>
								</pluginExecution>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>
											org.apache.maven.plugins
										</groupId>
										<artifactId>
											maven-dependency-plugin
										</artifactId>
										<versionRange>
											[2.1,)
										</versionRange>
										<goals>
											<goal>
												unpack-dependencies
											</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore />
									</action>
								</pluginExecution>
							</pluginExecutions>
						</lifecycleMappingMetadata>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>

	<repositories>
		<repository>
			<id>openmrs-repo</id>
			<name>OpenMRS Nexus Repository</name>
			<url>https://openmrs.jfrog.io/artifactory/public</url>
		</repository>
	</repositories>

	<pluginRepositories>
		<pluginRepository>
			<id>openmrs-repo</id>
			<name>OpenMRS Nexus Repository</name>
			<url>https://openmrs.jfrog.io/artifactory/public</url>
			<snapshots>
				<enabled>false</enabled>
			</snapshots>
		</pluginRepository>
	</pluginRepositories>

</project>
