<?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>

  <artifactId>odata4j-dist</artifactId>
  <packaging>pom</packaging>

  <parent>
    <groupId>org.odata4j</groupId>
    <artifactId>odata4j-parent</artifactId>
    <version>0.6.0</version>
    <relativePath>..</relativePath>
  </parent>

  <properties>
    <odata4j.clientbundle>odata4j-${project.version}-clientbundle</odata4j.clientbundle>
    <odata4j.nojpabundle>odata4j-${project.version}-nojpabundle</odata4j.nojpabundle>
    <odata4j.cxfbundle>odata4j-${project.version}-cxfbundle</odata4j.cxfbundle>
    <odata4j.bundle>odata4j-${project.version}-bundle</odata4j.bundle>
    <odata4j.core>odata4j-${project.version}-core</odata4j.core>
  </properties>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <executions>

          <!-- cxf bundle: everything with cxf -->
          <execution>
            <id>cxfbundle</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <appendAssemblyId>false</appendAssemblyId>
              <skipAssembly>false</skipAssembly>
              <finalName>${odata4j.cxfbundle}</finalName>
              <descriptors>
                <descriptor>src/main/assembly/cxfbundle.xml</descriptor>
              </descriptors>
            </configuration>
          </execution>

          <!-- core: odata4j-core only -->
          <execution>
            <id>core</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <finalName>${odata4j.core}</finalName>
              <appendAssemblyId>false</appendAssemblyId>
              <skipAssembly>false</skipAssembly>
              <descriptors>
                <descriptor>src/main/assembly/core.xml</descriptor>
              </descriptors>
            </configuration>
          </execution>

          <!-- clientbundle: minimum to run on a constrained client (android) -->
          <execution>
            <id>clientbundle</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <appendAssemblyId>false</appendAssemblyId>
              <skipAssembly>false</skipAssembly>
              <finalName>${odata4j.clientbundle}</finalName>
              <descriptors>
                <descriptor>src/main/assembly/clientbundle.xml</descriptor>
              </descriptors>
            </configuration>
          </execution>

          <!-- nojpabundle: minimum to run on a constrained server (appengine) -->
          <execution>
            <id>nojpabundle</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <appendAssemblyId>false</appendAssemblyId>
              <skipAssembly>false</skipAssembly>
              <finalName>${odata4j.nojpabundle}</finalName>
              <descriptors>
                <descriptor>src/main/assembly/nojpabundle.xml</descriptor>
              </descriptors>
            </configuration>
          </execution>

          <!-- bundle: everything (including jpa) -->
          <execution>
            <id>bundle</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <appendAssemblyId>false</appendAssemblyId>
              <skipAssembly>false</skipAssembly>
              <finalName>${odata4j.bundle}</finalName>
              <descriptors>
                <descriptor>src/main/assembly/bundle.xml</descriptor>
              </descriptors>
            </configuration>
          </execution>

        </executions>
      </plugin>

      <!-- Deploy attached bundles -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-artifacts</id>
            <phase>package</phase>
            <goals>
              <goal>attach-artifact</goal>
            </goals>
            <configuration>
              <artifacts>
                <artifact>
                  <file>${project.build.directory}/${odata4j.clientbundle}.jar</file>
                  <type>jar</type>
                  <classifier>clientbundle</classifier>
                </artifact>
                <artifact>
                  <file>${project.build.directory}/${odata4j.nojpabundle}.jar</file>
                  <type>jar</type>
                  <classifier>nojpabundle</classifier>
                </artifact>
                <artifact>
                  <file>${project.build.directory}/${odata4j.bundle}.jar</file>
                  <type>jar</type>
                  <classifier>bundle</classifier>
                </artifact>
                <artifact>
                  <file>${project.build.directory}/${odata4j.cxfbundle}.jar</file>
                  <type>jar</type>
                  <classifier>cxfbundle</classifier>
                </artifact>
              </artifacts>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <dependencies>
    <dependency>
      <artifactId>odata4j-core</artifactId>
      <groupId>org.odata4j</groupId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <artifactId>odata4j-jersey</artifactId>
      <groupId>org.odata4j</groupId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <artifactId>odata4j-cxf</artifactId>
      <groupId>org.odata4j</groupId>
      <version>${project.version}</version>
    </dependency>
  </dependencies>

</project>
