<?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>
    <parent>
        <groupId>org.bahmni.module</groupId>
        <artifactId>idgen-webservices</artifactId>
        <version>1.4.0</version>
    </parent>

    <artifactId>idgen-webservices-omod</artifactId>
    <packaging>jar</packaging>
    <name>ID Generation Web Services OMOD</name>
    <description>OMOD project for idgen-webservices</description>
    
    <properties>
        <MODULE_ID>${project.parent.artifactId}</MODULE_ID>
        <MODULE_NAME>${project.parent.name}</MODULE_NAME>
        <MODULE_VERSION>${project.parent.version}</MODULE_VERSION>
        <MODULE_PACKAGE>org.openmrs.module.idgen.webservices</MODULE_PACKAGE>
    </properties>
    
    <dependencies>
        <dependency>
            <groupId>org.bahmni.module</groupId>
            <artifactId>idgen-webservices-api</artifactId>
            <version>${project.parent.version}</version>
        </dependency>
        <dependency>
            <groupId>org.openmrs.web</groupId>
            <artifactId>openmrs-web</artifactId>
            <version>${openmrsCoreVersion}</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>javax.servlet</groupId>
                    <artifactId>servlet-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.openmrs.api</groupId>
            <artifactId>openmrs-api</artifactId>
            <version>${openmrsCoreVersion}</version>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.openmrs.web</groupId>
            <artifactId>openmrs-web</artifactId>
            <version>${openmrsCoreVersion}</version>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.openmrs.test</groupId>
            <artifactId>openmrs-test</artifactId>
            <version>${openmrsCoreVersion}</version>
            <type>pom</type>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.openmrs.module</groupId>
            <artifactId>webservices.rest-omod-common</artifactId>
            <version>${webservicesRestModuleVersion}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.openmrs.module</groupId>
            <artifactId>idgen-api</artifactId>
            <version>${idGenVersion}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.openmrs.test</groupId>
            <artifactId>openmrs-test</artifactId>
            <version>${openmrsCoreVersion}</version>
            <type>pom</type>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.openmrs.web</groupId>
            <artifactId>openmrs-web</artifactId>
            <version>${openmrsCoreVersion}</version>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <finalName>${project.parent.artifactId}-${project.parent.version}</finalName>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-resources-plugin</artifactId>
                    <configuration>
                        <includeEmptyDirs>true</includeEmptyDirs>
                    </configuration>
                </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.4,)
                                        </versionRange>
                                        <goals>
                                            <goal>unpack-dependencies
                                            </goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore/>
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <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>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>Expand moduleApplicationContext and messages</id>
                        <goals>
                            <goal>unpack-dependencies</goal>
                        </goals>
                        <phase>generate-resources</phase>
                        <configuration>
                            <includeGroupIds>${project.parent.groupId}</includeGroupIds>
                            <includeArtifactIds>${project.parent.artifactId}-api</includeArtifactIds>
                            <excludeTransitive>true</excludeTransitive>
                            <includes>**/*</includes>
                            <outputDirectory>${project.build.directory}/classes</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>