<!--
  ~ Version: 1.0
  ~
  ~ The contents of this file are subject to the OpenVPMS License Version
  ~ 1.0 (the 'License'); you may not use this file except in compliance with
  ~ the License. You may obtain a copy of the License at
  ~ http://www.openvpms.org/license/
  ~
  ~ Software distributed under the License is distributed on an 'AS IS' basis,
  ~ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  ~ for the specific language governing rights and limitations under the
  ~ License.
  ~
  ~ Copyright 2024 (C) OpenVPMS Ltd. All Rights Reserved.
  -->

<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.openvpms</groupId>
        <artifactId>openvpms</artifactId>
        <version>2.4.0.14-beta-2</version>
    </parent>

    <artifactId>openvpms-framework</artifactId>
    <packaging>jar</packaging>
    <name>OpenVPMS Framework</name>

    <issueManagement>
        <system>jira</system>
        <url>https://openvpms.atlassian.net/projects/OBF</url>
    </issueManagement>

    <build>
        <resources>
            <resource>
                <directory>${basedir}/src/main/java</directory>
                <includes>
                    <include>**/*.properties</include>
                </includes>
            </resource>
            <resource>
                <directory>${basedir}/src/main/java</directory>
                <includes>
                    <include>**/*.hbm.xml</include>
                    <include>**/*.xml</include>
                </includes>
            </resource>
            <resource>
                <directory>${basedir}/src/conf/ehcache</directory>
                <includes>
                    <include>ehcache.xml</include>
                </includes>
            </resource>
            <resource>
                <directory>${basedir}/src/main/resources</directory>
                <includes>
                    <include>**/*.properties</include>
                </includes>
            </resource>
        </resources>
        <testResources>
            <testResource>
                <directory>${basedir}/src/test/conf/log4j</directory>
                <includes>
                    <include>log4j.properties</include>
                </includes>
            </testResource>
            <testResource>
                <directory>${basedir}/src/test/java</directory>
                <includes>
                    <include>**/*.xml</include>
                    <include>**/*.adl</include>
                </includes>
            </testResource>
            <testResource>
                <directory>${basedir}/src/main/java</directory>
                <includes>
                    <include>**/*.properties</include>
                </includes>
            </testResource>
            <testResource>
                <directory>${basedir}/src/test/resources</directory>
                <includes>
                    <include>hibernate.cfg.xml</include>
                </includes>
                <filtering>true</filtering>
            </testResource>
            <testResource>
                <directory>${basedir}/src/test/resources</directory>
                <includes>
                    <include>*.xml</include>
                </includes>
            </testResource>
            <testResource>
                <directory>${basedir}/src/test/resources</directory>
                <includes>
                    <include>datasource-context.xml</include>
                    <include>userdao-context.xml</include>
                    <include>spy.properties</include>
                </includes>
            </testResource>
            <testResource>
                <directory>${basedir}/src/test/archetypes</directory>
                <includes>
                    <include>**/*.adl</include>
                    <include>**/*.xml</include>
                </includes>
            </testResource>
            <testResource>
                <directory>${basedir}/src/test/rules</directory>
                <includes>
                    <include>**/*.drl</include>
                    <include>*.xml</include>
                </includes>
            </testResource>
        </testResources>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>castor-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <schema>${basedir}/src/main/java/org/openvpms/tools/security/loader/security-loader.xsd
                            </schema>
                            <packaging>org.openvpms.tools.security.loader</packaging>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>hibernate3-maven-plugin</artifactId>
                <version>2.2</version>
                <configuration>
                    <componentProperties>
                        <drop>true</drop>
                        <jdk5>true</jdk5>
                        <configurationfile>target/test-classes/hibernate.cfg.xml</configurationfile>
                        <skip>${skipTests}</skip>
                    </componentProperties>
                </configuration>
                <executions>
                    <execution>
                        <phase>process-test-classes</phase>
                        <goals>
                            <goal>hbm2ddl</goal>
                        </goals>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>org.hibernate</groupId>
                        <artifactId>hibernate-core</artifactId>
                        <version>3.6.8.Final</version>
                    </dependency>
                    <dependency>
                        <groupId>${jdbc.groupId}</groupId>
                        <artifactId>${jdbc.artifactId}</artifactId>
                        <version>${jdbc.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <groupId>org.apache.maven.plugins</groupId>
                <executions>
                    <execution>
                        <phase>process-test-classes</phase>
                        <configuration>
                            <target unless="skipTests">
                                <java classname="org.openvpms.tools.archetype.loader.ArchetypeLoader" failonerror="true" fork="true">
                                    <classpath>
                                        <path refid="maven.test.classpath" />
                                        <pathelement path="${maven.build.dest}" />
                                        <pathelement path="${maven.test.dest}" />
                                        <pathelement path="${maven.build.dir}/hibernate" />
                                    </classpath>
                                    <!--jvmarg value="-agentlib:jdwp=transport=dt_shmem,server=y,suspend=y,address=openvpms_dev"/-->
                                    <jvmarg value="-Djdbc.driverClassName=${build.jdbc.driverClassName}" />
                                    <jvmarg value="-Djdbc.url=${build.jdbc.url}" />
                                    <jvmarg value="-Djdbc.username=${build.jdbc.username}" />
                                    <jvmarg value="-Djdbc.password=${build.jdbc.password}" />
                                    <arg line="-v -s -c --context org/openvpms/tools/data/loader/archetype-data-loader-appcontext.xml -m src/test/archetypes/org/openvpms/archetype/assertionTypes.xml -d src/test/archetypes/org/openvpms/archetype" />
                                </java>
                            </target>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <!--debugForkedProcess>true</debugForkedProcess-->
                    <excludes>
                        <exclude>**/BaseTestCase.java</exclude>
                        <exclude>**/HibernateInfoModelTestCase.java</exclude>
                    </excludes>
                    <includes>
                        <include>**/*TestCase.java</include>
                    </includes>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-source-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupId>org.openvpms</groupId>
            <artifactId>openvpms-framework-api</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.sun.activation</groupId>
            <artifactId>jakarta.activation</artifactId>
        </dependency>
        <dependency>
            <groupId>jakarta.annotation</groupId>
            <artifactId>jakarta.annotation-api</artifactId>
            <scope>provided</scope>
            <!-- Servlet containers provide a version of this -->
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-text</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.servicemix.specs</groupId>
            <artifactId>org.apache.servicemix.specs.jaxp-api-1.4</artifactId>
        </dependency>
        <dependency>
            <!-- required by hibernate-core -->
            <groupId>org.apache.servicemix.bundles</groupId>
            <artifactId>org.apache.servicemix.bundles.dom4j</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>jakarta.xml.bind</groupId>
            <artifactId>jakarta.xml.bind-api</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>commons-resources</groupId>
            <artifactId>commons-resources</artifactId>
            <version>${commons.resources.version}</version>
        </dependency>
        <dependency>
            <groupId>org.ehcache</groupId>
            <artifactId>ehcache</artifactId>
        </dependency>
        <dependency>
            <groupId>org.quartz-scheduler</groupId>
            <artifactId>quartz</artifactId>
        </dependency>
        <dependency>
            <groupId>com.sun.xml.bind</groupId>
            <artifactId>jaxb-osgi</artifactId>
            <scope>runtime</scope>
        </dependency>
        <!--dependency>
            <groupId>org.apache.servicemix.bundles</groupId>
            <artifactId>org.apache.servicemix.bundles.jaxb-impl</artifactId>
            <scope>runtime</scope>
        </dependency-->
        <dependency>
            <groupId>org.apache.servicemix.bundles</groupId>
            <artifactId>org.apache.servicemix.bundles.spring-aop</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.servicemix.bundles</groupId>
            <artifactId>org.apache.servicemix.bundles.spring-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.servicemix.bundles</groupId>
            <artifactId>org.apache.servicemix.bundles.spring-context</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.servicemix.bundles</groupId>
            <artifactId>org.apache.servicemix.bundles.spring-context-support</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.servicemix.bundles</groupId>
            <artifactId>org.apache.servicemix.bundles.spring-beans</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.servicemix.bundles</groupId>
            <artifactId>org.apache.servicemix.bundles.spring-expression</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.servicemix.bundles</groupId>
            <artifactId>org.apache.servicemix.bundles.spring-jdbc</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.servicemix.bundles</groupId>
            <artifactId>org.apache.servicemix.bundles.spring-orm</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.servicemix.bundles</groupId>
            <artifactId>org.apache.servicemix.bundles.spring-security-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.servicemix.bundles</groupId>
            <artifactId>org.apache.servicemix.bundles.spring-security-config</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.servicemix.bundles</groupId>
            <artifactId>org.apache.servicemix.bundles.spring-tx</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.servicemix.bundles</groupId>
            <artifactId>org.apache.servicemix.bundles.aopalliance</artifactId>
        </dependency>
        <dependency>
            <!-- used by spring-aop -->
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjweaver</artifactId>
            <version>${aspectj.version}</version>
        </dependency>
        <dependency>
            <!-- replaces commons logging required by commons-bean-utils, castor-xml -->
            <groupId>org.slf4j</groupId>
            <artifactId>jcl-over-slf4j</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>springmodules</groupId>
            <artifactId>springmodules</artifactId>
            <version>${springmodules.version}</version>
        </dependency>
        <dependency>
            <groupId>drools</groupId>
            <artifactId>drools-all-jdk5</artifactId>
            <version>${drools.version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>drools</groupId>
            <artifactId>jsr94</artifactId>
            <version>${drools.jsr94.version}</version>
        </dependency>
        <dependency>
            <!-- used by drools -->
            <groupId>janino</groupId>
            <artifactId>janino</artifactId>
            <version>${janino.version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>jug</groupId>
            <artifactId>jug</artifactId>
            <version>${jug.version}</version>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-collections</groupId>
            <artifactId>commons-collections</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-collections4</artifactId>
        </dependency>
        <dependency>
            <groupId>org.codehaus.castor</groupId>
            <artifactId>castor-xml</artifactId>
        </dependency>
        <dependency>
            <groupId>com.thoughtworks.xstream</groupId>
            <artifactId>xstream</artifactId>
        </dependency>
        <dependency>
            <groupId>jsap</groupId>
            <artifactId>JSAP</artifactId>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-jcache</artifactId>
        </dependency>
        <dependency>
            <!-- NOTE: this is not really required, but if javax.validation:validation-api is on the classpath -->
            <!-- Hibernate performs validation, and requires a javax.el implementation                         -->
            <!-- The validation-api is pulled in by org.glassfish.jersey.core                                  -->
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-validator</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <!-- see comment about hibernate-validator -->
            <groupId>javax.el</groupId>
            <artifactId>javax.el-api</artifactId>
        </dependency>
        <dependency>
            <!-- see comment about hibernate-validator -->
            <groupId>org.glassfish.web</groupId>
            <artifactId>javax.el</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.servicemix.bundles</groupId>
            <artifactId>org.apache.servicemix.bundles.oro</artifactId>
            <version>${oro.version}</version>
        </dependency>
        <dependency>
            <groupId>stax</groupId>
            <artifactId>stax</artifactId>
            <version>${stax.version}</version>
            <exclusions>
                <exclusion>
                    <artifactId>xmlbeans-jsr173-api</artifactId>
                    <groupId>xmlbeans</groupId>
                </exclusion>
            </exclusions>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.servicemix.bundles</groupId>
            <artifactId>org.apache.servicemix.bundles.xerces</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>commons-jxpath</groupId>
            <artifactId>commons-jxpath</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-beanutils</groupId>
            <artifactId>commons-beanutils</artifactId>
        </dependency>
        <dependency>
            <!-- required by org.codehaus.castor:castor-xml -->
            <groupId>org.apache.servicemix.bundles</groupId>
            <artifactId>org.apache.servicemix.bundles.javax-inject</artifactId>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.servicemix.bundles</groupId>
            <artifactId>org.apache.servicemix.bundles.spring-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-dbcp2</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>${jdbc.groupId}</groupId>
            <artifactId>${jdbc.artifactId}</artifactId>
            <version>${jdbc.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>p6spy</groupId>
            <artifactId>p6spy</artifactId>
            <scope>test</scope>
        </dependency>

    </dependencies>

</project>
