<?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.openmicroscopy</groupId>
    <artifactId>ome-model</artifactId>
    <version>5.5.4</version>
    <relativePath>..</relativePath>
  </parent>

  <artifactId>ome-xml</artifactId>

  <name>OME XML library</name>
  <description>A library for working with OME-XML metadata structures.</description>
  <url>http://www.openmicroscopy.org/site/support/ome-model/ome-xml/java-library.html</url>
  <inceptionYear>2006</inceptionYear>
  <organization>
    <name>Open Microscopy Environment</name>
    <url>http://www.openmicroscopy.org/</url>
  </organization>
  <licenses>
    <license>
      <name>Simplified BSD License</name>
      <url>https://opensource.org/licenses/BSD-2-Clause</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <dependencies>
    <!-- There should be a specification dependency here, but
         there's a cyclic reference which needs to be resolved -->

    <dependency>
      <groupId>org.openmicroscopy</groupId>
      <artifactId>ome-common</artifactId>
      <version>${ome_common.version}</version>
    </dependency>

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>${slf4j.version}</version>
    </dependency>

    <dependency>
      <groupId>joda-time</groupId>
      <artifactId>joda-time</artifactId>
      <version>2.2</version>
    </dependency>

    <dependency>
      <groupId>org.testng</groupId>
      <artifactId>testng</artifactId>
      <version>${testng.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <version>${logback.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-core</artifactId>
      <version>${logback.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <properties>
    <project.rootdir>${basedir}/..</project.rootdir>
    <xsdfu.script>../xsd-fu/xsd-fu</xsdfu.script>
    <xsdfu.modelpath>${basedir}/target/generated-sources/xsd-fu</xsdfu.modelpath>
    <xsdfu.metadatapath>${basedir}/target/generated-sources/xsd-fu</xsdfu.metadatapath>
  </properties>

  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>1.5.0</version>
        <executions>
          <!-- Generate the OME model object classes -->
          <execution>
            <id>xsd-fu-java-classes</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>exec</goal>
            </goals>
            <configuration>
              <executable>python</executable>
              <arguments>
                <argument>${xsdfu.script}</argument>
                <argument>omexml_model_all</argument>
                <argument>--output-directory=${xsdfu.modelpath}/</argument>
                <argument>--print-generated</argument>
                <argument>${project.rootdir}/${ome.model.omeschema}</argument>
              </arguments>
            </configuration>
          </execution>

          <!-- Generate the metadata interfaces -->
          <execution>
            <id>xsd-fu-metadata-store</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>exec</goal>
            </goals>
            <configuration>
              <executable>python</executable>
              <arguments>
                <argument>${xsdfu.script}</argument>
                <argument>omexml_metadata_all</argument>
                <argument>--output-directory=${xsdfu.metadatapath}/</argument>
                <argument>--print-generated</argument>
                <argument>${project.rootdir}/${ome.model.omeschema}</argument>
              </arguments>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>1.12</version>
        <executions>
          <execution>
            <id>add-source</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>add-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>target/generated-sources/xsd-fu</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>
            <manifest>
              <packageName>ome.xml</packageName>
            </manifest>
          </archive>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <suiteXmlFiles>
            <suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
          </suiteXmlFiles>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <configuration>
          <licenseName>bsd_2</licenseName>
          <organizationName>Open Microscopy Environment:
  - Massachusetts Institute of Technology
  - National Institutes of Health
  - University of Dundee
  - Board of Regents of the University of Wisconsin-Madison
  - Glencoe Software, Inc.</organizationName>
          <projectName>OME-XML Java library for working with OME-XML metadata structures.</projectName>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>
