<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>org.eurekaclinical</groupId>
    <artifactId>eurekaclinical-ontology</artifactId>
    <packaging>jar</packaging>
    <version>1.2</version>
    <name>Eureka! Clinical Ontology Installation Files</name>
    <description>Ontology liquibase files.</description>
    <inceptionYear>2016</inceptionYear>

    <parent>
        <groupId>org.eurekaclinical</groupId>
        <artifactId>eurekaclinical-parent</artifactId>
        <version>1</version>
    </parent>

    <url>https://github.com/eurekaclinical/eurekaclinical-ontology.git</url>

    <scm>
        <connection>scm:git:https://github.com/eurekaclinical/eurekaclinical-ontology.git</connection>
        <developerConnection>scm:git:https://github.com/eurekaclinical/eurekaclinical-ontology.git</developerConnection>
        <url>https://github.com/eurekaclinical/eurekaclinical-ontology.git</url>
        <tag>eurekaclinical-ontology-1.2</tag>
    </scm>
	
    <issueManagement>
        <system>GitHub</system>
        <url>https://github.com/eurekaclinical/eurekaclinical-ontology/issues</url>
    </issueManagement>
    
    <build>
        <plugins>
            <plugin>
                <groupId>org.jasig.maven</groupId>
                <artifactId>maven-notice-plugin</artifactId>
                <configuration>
                    <noticeTemplate>etc/NOTICE.template</noticeTemplate>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <configuration>
                    <skipUpdateLicense>true</skipUpdateLicense>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.liquibase</groupId>
                <artifactId>liquibase-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>liquibase-create-table-access-meta-schema</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>update</goal>
                        </goals>
                        <configuration>
                            <changeLogFile>src/main/resources/dbmigration/create-table-access-changelog.xml</changeLogFile>
                            <url>jdbc:h2:file:${project.build.directory}/classes/eureka-db/eureka-ontology</url>
                            <dropFirst>true</dropFirst>
                        </configuration>
                    </execution>
                    <execution>
                        <id>liquibase-populate-i2b2-meta-schema</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>update</goal>
                        </goals>
                        <configuration>
                            <changeLogFile>src/main/resources/dbmigration/i2b2-meta-schema-changelog.xml</changeLogFile>
                            <url>jdbc:h2:file:${project.build.directory}/classes/eureka-db/eureka-ontology</url>
                        </configuration>
                    </execution>
                    <execution>
                        <id>liquibase-populate-eureka-ontology-EK_DEMOG</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>update</goal>
                        </goals>
                        <configuration>
                            <changeLogFile>src/main/resources/dbmigration/eureka-ontology-EK_DEMOG-changelog.xml</changeLogFile>
                            <url>jdbc:h2:file:${project.build.directory}/classes/eureka-db/eureka-ontology</url>
                        </configuration>
                    </execution>
                    <execution>
                        <id>liquibase-populate-eureka-ontology-EK_ICD9D</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>update</goal>
                        </goals>
                        <configuration>
                            <changeLogFile>src/main/resources/dbmigration/eureka-ontology-EK_ICD9D-changelog.xml</changeLogFile>
                            <url>jdbc:h2:file:${project.build.directory}/classes/eureka-db/eureka-ontology</url>
                        </configuration>
                    </execution>
                    <execution>
                        <id>liquibase-populate-eureka-ontology-EK_ICD9P</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>update</goal>
                        </goals>
                        <configuration>
                            <changeLogFile>src/main/resources/dbmigration/eureka-ontology-EK_ICD9P-changelog.xml</changeLogFile>
                            <url>jdbc:h2:file:${project.build.directory}/classes/eureka-db/eureka-ontology</url>
                        </configuration>
                    </execution>
                    <execution>
                        <id>liquibase-populate-eureka-ontology-EK_LABS</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>update</goal>
                        </goals>
                        <configuration>
                            <changeLogFile>src/main/resources/dbmigration/eureka-ontology-EK_LABS-changelog.xml</changeLogFile>
                            <url>jdbc:h2:file:${project.build.directory}/classes/eureka-db/eureka-ontology</url>
                        </configuration>
                    </execution>
                    <execution>
                        <id>liquibase-populate-eureka-ontology-EK_MED_ORDERS</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>update</goal>
                        </goals>
                        <configuration>
                            <changeLogFile>src/main/resources/dbmigration/eureka-ontology-EK_MED_ORDERS-changelog.xml</changeLogFile>
                            <url>jdbc:h2:file:${project.build.directory}/classes/eureka-db/eureka-ontology</url>
                        </configuration>
                    </execution>
                    <execution>
                        <id>liquibase-populate-eureka-ontology-EK_VITALS</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>update</goal>
                        </goals>
                        <configuration>
                            <changeLogFile>src/main/resources/dbmigration/eureka-ontology-EK_VITALS-changelog.xml</changeLogFile>
                            <url>jdbc:h2:file:${project.build.directory}/classes/eureka-db/eureka-ontology</url>
                        </configuration>
                    </execution>
                    <execution>
                        <id>liquibase-populate-eureka-ontology-EK_ICD10CM</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>update</goal>
                        </goals>
                        <configuration>
                            <changeLogFile>src/main/resources/dbmigration/eureka-ontology-EK_ICD10CM-changelog.xml</changeLogFile>
                            <url>jdbc:h2:file:${project.build.directory}/classes/eureka-db/eureka-ontology</url>
                        </configuration>
                    </execution>
                    <execution>
                        <id>liquibase-populate-eureka-ontology-EK_ICD10PCS</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>update</goal>
                        </goals>
                        <configuration>
                            <changeLogFile>src/main/resources/dbmigration/eureka-ontology-EK_ICD10PCS-changelog.xml</changeLogFile>
                            <url>jdbc:h2:file:${project.build.directory}/classes/eureka-db/eureka-ontology</url>
                        </configuration>
                    </execution>     
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>sql-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>analyze-eureka-ontology-schema</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>execute</goal>
                        </goals>
                        <configuration>
                            <driver>org.h2.Driver</driver>
                            <url>jdbc:h2:file:${project.build.directory}/classes/eureka-db/eureka-ontology;INIT=ANALYZE</url>
                            <sqlCommand />
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
