<!--
  ~ 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 2026 (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/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.openvpms</groupId>
        <artifactId>openvpms</artifactId>
        <version>2.4.0.13.2</version>
    </parent>

    <artifactId>openvpms-release</artifactId>

    <packaging>pom</packaging>
    <!-- hack to get round the fact that zip is not a supported package type -->

    <name>OpenVPMS Release</name>
    <description>The OpenVPMS Release Distribution
    </description>

    <!-- ========================================================================================================== -->
    <!-- Report generation notes                                                                                    -->
    <!--                                                                                                            -->
    <!-- JasperReports are scaled from A4 to A5 and US-Letter versions using via an Ant script, build-reports.xml   -->
    <!-- This must be invoked manually using:                                                                       -->
    <!-- > mvn antrun:run                                                                                         -->
    <!-- ========================================================================================================== -->

    <dependencies>
        <dependency>
            <groupId>org.openvpms</groupId>
            <artifactId>openvpms-framework</artifactId>
        </dependency>
        <dependency>
            <groupId>org.openvpms</groupId>
            <artifactId>openvpms-archetypes</artifactId>
        </dependency>
        <dependency>
            <groupId>org.openvpms</groupId>
            <artifactId>openvpms-reports</artifactId>
        </dependency>
        <dependency>
            <groupId>org.openvpms</groupId>
            <artifactId>clickatell-openvpms-plugin</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.openvpms</groupId>
            <artifactId>deputy-openvpms-plugin</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.openvpms</groupId>
            <artifactId>openvpms-tools</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.openvpms</groupId>
            <artifactId>openvpms-web-app</artifactId>
            <version>${project.version}</version>
            <type>war</type>
        </dependency>
        <dependency>
            <groupId>org.openvpms</groupId>
            <artifactId>openvpms-etl-load</artifactId>
        </dependency>
        <dependency>
            <groupId>org.openvpms</groupId>
            <artifactId>jasperreports-scaler</artifactId>
            <version>1.6</version>
        </dependency>
        <dependency>
            <groupId>org.openvpms</groupId>
            <artifactId>openvpms-pentaho-plugin</artifactId>
            <version>${project.version}</version>
            <type>zip</type>
        </dependency>
        <dependency>
            <groupId>org.openvpms</groupId>
            <artifactId>openvpms-db</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-dbcp2</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-slf4j-impl</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
            <version>${log4j2.version}</version>
            <scope>compile</scope> <!-- required for jasperreports-scaler -->
        </dependency>
        <dependency>
            <groupId>${jdbc.groupId}</groupId>
            <artifactId>${jdbc.artifactId}</artifactId>
            <version>${jdbc.version}</version>
        </dependency>
    </dependencies>

    <properties>
        <buildNumber>${git.commit.time}.${git.commit.id.abbrev}</buildNumber>
    </properties>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-enforcer-plugin</artifactId>
                <executions>
                    <execution>
                        <id>enforce-maven</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <banDuplicateClasses>
                                    <ignoreClasses>
                                        <!-- the following are required by xstream -->
                                        <ignoreClass>org.xmlpull.v1.XmlPullParser</ignoreClass>
                                        <ignoreClass>org.xmlpull.v1.XmlPullParserException</ignoreClass>
                                        <!-- the following are included by biz.aQute.bnd:biz.aQute.bndlib -->
                                        <!-- org.apache.felix:org.apache.felix.framework                  -->
                                        <ignoreClass>org.osgi.resource.*</ignoreClass>
                                    </ignoreClasses>
                                    <dependencies>
                                        <dependency>
                                            <artifactId>clickatell-openvpms-plugin</artifactId>
                                            <ignoreClasses>
                                                <ignoreClass>*</ignoreClass>
                                            </ignoreClasses>
                                        </dependency>
                                        <dependency>
                                            <artifactId>deputy-openvpms-plugin</artifactId>
                                            <ignoreClasses>
                                                <ignoreClass>*</ignoreClass>
                                            </ignoreClasses>
                                        </dependency>
                                        <dependency>
                                            <artifactId>atlassian-httpclient-plugin</artifactId>
                                            <ignoreClasses>
                                                <ignoreClass>*</ignoreClass>
                                            </ignoreClasses>
                                        </dependency>
                                        <dependency>
                                            <artifactId>atlassian-rest-module</artifactId>
                                            <ignoreClasses>
                                                <ignoreClass>*</ignoreClass>
                                            </ignoreClasses>
                                        </dependency>
                                        <dependency>
                                            <groupId>org.glassfish.jersey.core</groupId>
                                            <artifactId>jersey-server</artifactId>
                                            <ignoreClasses>
                                                <ignoreClass>*</ignoreClass>
                                            </ignoreClasses>
                                        </dependency>
                                        <dependency>
                                            <groupId>com.sun.jersey</groupId>
                                            <artifactId>jersey-server</artifactId>
                                            <ignoreClasses>
                                                <ignoreClass>*</ignoreClass>
                                            </ignoreClasses>
                                        </dependency>
                                    </dependencies>
                                    <scopes>
                                        <scope>compile</scope>
                                        <scope>provided</scope>
                                    </scopes>
                                    <findAllDuplicates>true</findAllDuplicates>
                                    <ignoreWhenIdentical>true</ignoreWhenIdentical>
                                </banDuplicateClasses>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <!-- used to generate the buildNumber property, which is replaced in readme.txt -->
                <groupId>pl.project13.maven</groupId>
                <artifactId>git-commit-id-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>revision</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <dateFormat>yyyyMMdd-HHmmss</dateFormat>
                    <dotGitDirectory>${project.basedir}/.git</dotGitDirectory>
                    <generateGitPropertiesFile>false</generateGitPropertiesFile>
                    <injectAllReactorProjects>true</injectAllReactorProjects>
                    <skipPoms>false</skipPoms>
                </configuration>
            </plugin>
            <plugin>
                <!-- use the dependency plugin to get the .adl files from archetypes and sms-->
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>test-compile</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <artifactItems>
                        <artifactItem>
                            <groupId>org.openvpms</groupId>
                            <artifactId>openvpms-archetypes</artifactId>
                            <version>${project.version}</version>
                            <outputDirectory>target/archetypes</outputDirectory>
                            <includes>org/**/*.adl,org/**/assertionTypes.xml</includes>
                        </artifactItem>
                        <artifactItem>
                            <groupId>org.openvpms</groupId>
                            <artifactId>openvpms-plugin-framework-bundles</artifactId>
                            <version>${project.version}</version>
                            <type>zip</type>
                            <outputDirectory>target/plugins</outputDirectory>
                        </artifactItem>
                    </artifactItems>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>resources</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <!-- build the release zip -->
                <artifactId>maven-assembly-plugin</artifactId>
                <configuration>
                    <appendAssemblyId>false</appendAssemblyId>
                    <descriptors>
                        <descriptor>src/assemblies/assembly.xml</descriptor>
                    </descriptors>
                </configuration>
                <executions>
                    <execution>
                        <id>make-assembly</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <!-- helper to load report templates for testing -->
                <groupId>org.openvpms</groupId>
                <artifactId>openvpms-report-maven-plugin</artifactId>
                <version>${project.version}</version>
                <configuration>
                    <files>
                        <file>src/reports/documents-A5.xml</file>
                        <file>src/reports/reports-A4.xml</file>
                    </files>
                    <driver>${build.jdbc.driverClassName}</driver>
                    <url>${build.jdbc.url}</url>
                    <username>${build.jdbc.username}</username>
                    <password>${build.jdbc.password}</password>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>${jdbc.groupId}</groupId>
                        <artifactId>${jdbc.artifactId}</artifactId>
                        <version>${jdbc.version}</version>
                    </dependency>
                </dependencies>
            </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/classes/hibernate.cfg.xml</configurationfile>
                    </componentProperties>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>${jdbc.groupId}</groupId>
                        <artifactId>${jdbc.artifactId}</artifactId>
                        <version>${jdbc.version}</version>
                    </dependency>
                    <dependency>
                        <!-- this dependency is required to get hibernate to
                             work with cobertura during site generation
                             see http://jira.codehaus.org/browse/MCOBERTURA-26
                         -->
                        <groupId>net.sourceforge.cobertura</groupId>
                        <artifactId>cobertura</artifactId>
                        <version>1.9.2</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <configuration>
                    <target>
                        <property name="compile_classpath" refid="maven.runtime.classpath" />
                        <ant antfile="${basedir}/build-reports.xml">
                            <target name="scale" />
                        </ant>
                    </target>
                </configuration>
            </plugin>
        </plugins>
        <resources>
            <resource>
                <directory>${basedir}/src/conf/hibernate</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
    </build>

</project>
