<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>
  <!-- ====================================================================== -->
  <!-- P A R E N T  P R O J E C T  D E S C R I P T I O N                      -->
  <!-- ====================================================================== -->
  <parent>
    <groupId>com.day.crx</groupId>
    <artifactId>repository</artifactId>
    <version>1.4.1</version>
    <relativePath>../parent</relativePath>
  </parent>

  <!-- ====================================================================== -->
  <!-- P R O J E C T  D E S C R I P T I O N                                   -->
  <!-- ====================================================================== -->
  <groupId>com.day.crx</groupId>
  <artifactId>crx-rmi</artifactId>

  <name>Day CRX RMI Connector</name>
  <description>The CRX RMI Connector</description>

  <!-- ====================================================================== -->
  <!-- D E P E N D E N C I E S                                                -->
  <!-- ====================================================================== -->
  <dependencies>
    <dependency>
      <groupId>${pom.groupId}</groupId>
      <artifactId>crx-api</artifactId>
      <version>${pom.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.jackrabbit</groupId>
      <artifactId>jackrabbit-jcr-rmi</artifactId>
    </dependency>

    <dependency>
      <groupId>javax.jcr</groupId>
      <artifactId>jcr</artifactId>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-simple</artifactId>
    </dependency>
    <dependency>
      <groupId>xerces</groupId>
      <artifactId>xercesImpl</artifactId>
    </dependency>

  </dependencies>

  <!-- ====================================================================== -->
  <!-- B U I L D   D E F I N I T I O N                                        -->
  <!-- ====================================================================== -->
  <build>
    <plugins>
      <!-- skip tests -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <skip>true</skip>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <!-- ====================================================================== -->
    <!-- T O O L S . J A R   P R O F I L E                                -->
    <!-- ====================================================================== -->
    <profile>
      <id>tools-jar</id>
      <activation>
        <os>
          <family>!mac</family>
        </os>
      </activation>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-antrun-plugin</artifactId>
            <executions>
              <execution>
                <id>rmic</id>
                <phase>compile</phase>
                <configuration>
                  <tasks>
                    <echo>Compile RMI stubs</echo>
                    <rmic base="${project.build.outputDirectory}" verify="true" includes="com/day/crx/rmi/server/**/Server*.class,org/apache/jackrabbit/rmi/server/**/Server*.class" classpathref="maven.compile.classpath" />
                  </tasks>
                </configuration>
                <goals>
                  <goal>run</goal>
                </goals>
              </execution>
            </executions>
            <dependencies>
              <dependency>
                <groupId>sun</groupId>
                <artifactId>tools</artifactId>
                <version>1.0</version>
                <scope>system</scope>
                <systemPath>${java.home}/../lib/tools.jar</systemPath>
              </dependency>
            </dependencies>
          </plugin>
        </plugins>
      </build>
    </profile>
    <!-- ====================================================================== -->
    <!-- N O   T O O L S . J A R   P R O F I L E                                -->
    <!-- ====================================================================== -->
    <profile>
      <id>non-tools-jar</id>
      <activation>
        <os>
          <family>mac</family>
        </os>
      </activation>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-antrun-plugin</artifactId>
            <executions>
              <execution>
                <id>rmic</id>
                <phase>compile</phase>
                <configuration>
                  <tasks>
                    <echo>Compile RMI stubs</echo>
                    <rmic base="${project.build.outputDirectory}" verify="true" includes="com/day/crx/rmi/server/**/Server*.class,org/apache/jackrabbit/rmi/server/**/Server*.class" classpathref="maven.compile.classpath" />
                  </tasks>
                </configuration>
                <goals>
                  <goal>run</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>