<?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>
  <groupId>org.crashub</groupId>
  <artifactId>jcr.parent</artifactId>
  <packaging>pom</packaging>
  <version>1.0.0</version>

  <parent>
    <groupId>org.sonatype.oss</groupId>
    <artifactId>oss-parent</artifactId>
    <version>7</version>
  </parent>

  <name>CRaSH JCR Extension</name>
  <description>CRaSH extension for managing and connecting to Java Content Repository servers</description>
  <url>http://www.crashub.org/</url>

  <organization>
    <name>eXo Platform SAS</name>
    <url>http://www.exoplatform.com</url>
  </organization>

  <licenses>
    <license>
      <name>LGPL, version 2.1</name>
      <url>http://www.opensource.org/licenses/lgpl-license.php</url>
    </license>
  </licenses>

  <scm>
    <connection>scm:git:git://github.com/crashub/jcr.git</connection>
    <developerConnection>scm:git:ssh://git@github.com/crashub/jcr.git</developerConnection>
    <url>http://www.crashub.org</url>
  </scm>

  <developers>
    <developer>
      <id>julien.viet</id>
      <name>Julien Viet</name>
      <email>julien.viet@exoplatform.com</email>
      <roles>
        <role>Owner</role>
      </roles>
    </developer>
    <developer>
      <id>defrancea</id>
      <name>Alain Defrance</name>
      <email>alain.defrance@exoplatform.com</email>
      <roles>
        <role>Committer</role>
      </roles>
    </developer>
    <developer>
      <id>aheritier</id>
      <name>Arnaud Heritier</name>
      <email>arnaud.heritier@exoplatform.com</email>
      <roles>
        <role>Committer</role>
      </roles>
    </developer>
    <developer>
      <id>ehugonnet</id>
      <name>Emmanuel Hugonnet</name>
      <email>emmanuel.hugonnet@silverpeas.com</email>
      <roles>
        <role>Contributor</role>
      </roles>
    </developer>
  </developers>

  <properties>

    <!-- maven-release-plugin -->
    <useReleaseProfile>false</useReleaseProfile>
    <arguments>-Prelease,sign-artifacts</arguments>
    <pushChanges>false</pushChanges>
    <autoVersionSubmodules>true</autoVersionSubmodules>

    <!-- Java 6 -->
    <maven.compiler.source>6</maven.compiler.source>
    <maven.compiler.target>6</maven.compiler.target>

    <!-- Encoding -->
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

  </properties>

  <dependencyManagement>
    <dependencies>

      <!-- -->
      <dependency>
        <groupId>org.crashub</groupId>
        <artifactId>jcr.core</artifactId>
        <version>1.0.0</version>
      </dependency>
      <dependency>
        <groupId>org.crashub</groupId>
        <artifactId>jcr.core</artifactId>
        <classifier>standalone</classifier>
        <version>1.0.0</version>
      </dependency>
      <dependency>
        <groupId>org.crashub</groupId>
        <artifactId>jcr.core</artifactId>
        <type>test-jar</type>
        <version>1.0.0</version>
      </dependency>
      <dependency>
        <groupId>org.crashub</groupId>
        <artifactId>jcr.core</artifactId>
        <type>war</type>
        <version>1.0.0</version>
      </dependency>

      <!-- -->
      <dependency>
        <groupId>org.crashub</groupId>
        <artifactId>jcr.jackrabbit</artifactId>
        <type>war</type>
        <version>1.0.0</version>
      </dependency>

      <!-- -->
      <dependency>
        <groupId>org.crashub</groupId>
        <artifactId>jcr.exo</artifactId>
        <type>war</type>
        <version>1.0.0</version>
      </dependency>

      <!-- -->
      <dependency>
        <groupId>org.crashub</groupId>
        <artifactId>jcr.doc</artifactId>
        <classifier>html</classifier>
        <type>zip</type>
        <version>1.0.0</version>
      </dependency>

      <!-- -->
      <dependency>
        <groupId>org.crashub</groupId>
        <artifactId>crash.shell</artifactId>
        <version>1.3.0</version>
      </dependency>
      <dependency>
        <groupId>org.crashub</groupId>
        <artifactId>crash.shell</artifactId>
        <classifier>standalone</classifier>
        <version>1.3.0</version>
      </dependency>
      <dependency>
        <groupId>org.crashub</groupId>
        <artifactId>crash.shell</artifactId>
        <type>test-jar</type>
        <version>1.3.0</version>
      </dependency>
      <dependency>
        <groupId>org.crashub</groupId>
        <artifactId>crash.connectors.ssh</artifactId>
        <version>1.3.0</version>
      </dependency>
      <dependency>
        <groupId>org.crashub</groupId>
        <artifactId>crash.packaging</artifactId>
        <type>war</type>
        <version>1.3.0</version>
      </dependency>
      <dependency>
        <groupId>commons-logging</groupId>
        <artifactId>commons-logging</artifactId>
        <version>1.1.1</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>1.7.2</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-jdk14</artifactId>
        <version>1.7.2</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-simple</artifactId>
        <version>1.7.2</version>
      </dependency>
      <dependency>
        <groupId>javax.jcr</groupId>
        <artifactId>jcr</artifactId>
        <version>1.0</version>
      </dependency>
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.8.2</version>
      </dependency>
      <dependency>
        <groupId>org.jboss.shrinkwrap</groupId>
        <artifactId>shrinkwrap-api</artifactId>
        <version>1.0.0</version>
      </dependency>
      <dependency>
        <groupId>org.jboss.shrinkwrap</groupId>
        <artifactId>shrinkwrap-impl-base</artifactId>
        <version>1.0.0</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <modules>
    <module>core</module>
    <module>exo</module>
    <module>jackrabbit</module>
    <module>doc</module>
    <module>distrib</module>
  </modules>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-resources-plugin</artifactId>
          <version>2.6</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>2.1.2</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <version>2.1</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>2.8</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>2.3.2</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>2.3.1</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-antrun-plugin</artifactId>
          <version>1.6</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-dependency-plugin</artifactId>
          <version>2.1</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-install-plugin</artifactId>
          <version>2.3.1</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>2.5</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-clean-plugin</artifactId>
          <version>2.4.1</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-war-plugin</artifactId>
          <version>2.1.1</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>build-helper-maven-plugin</artifactId>
          <version>1.5</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>exec-maven-plugin</artifactId>
          <version>1.1.1</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-gpg-plugin</artifactId>
          <version>1.1</version>
        </plugin>
        <plugin>
          <groupId>com.github.github</groupId>
          <artifactId>site-maven-plugin</artifactId>
          <version>0.3</version>
        </plugin>
        <plugin>
          <groupId>org.asciidoctor</groupId>
          <artifactId>asciidoctor-maven-plugin</artifactId>
          <version>0.1.4</version>
        </plugin>

        <!-- Make standalone configuration -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-assembly-plugin</artifactId>
          <version>2.2.1</version>
          <executions>
            <execution>
              <id>make-standalone</id>
              <phase>package</phase>
              <goals>
                <goal>single</goal>
              </goals>
              <configuration>
                <classifier>standalone</classifier>
                <ignoreMissingDescriptor>true</ignoreMissingDescriptor>
                <descriptors>
                  <descriptor>src/main/assembly/standalone.xml</descriptor>
                </descriptors>
              </configuration>
            </execution>
            <execution>
              <id>make-packaging</id>
              <phase>package</phase>
              <goals>
                <goal>single</goal>
              </goals>
              <configuration>
                <appendAssemblyId>false</appendAssemblyId>
                <ignoreMissingDescriptor>true</ignoreMissingDescriptor>
                <descriptors>
                  <descriptor>src/main/assembly/packaging.xml</descriptor>
                </descriptors>
              </configuration>
            </execution>
            <execution>
              <id>make-war</id>
              <phase>package</phase>
              <goals>
                <goal>single</goal>
              </goals>
              <configuration>
                <appendAssemblyId>false</appendAssemblyId>
                <ignoreMissingDescriptor>true</ignoreMissingDescriptor>
                <descriptors>
                  <descriptor>src/main/assembly/war.xml</descriptor>
                </descriptors>
              </configuration>
            </execution>
          </executions>
        </plugin>

        <plugin>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.12</version>
          <executions>
            <execution>
              <id>default-test</id>
              <configuration>
                <includes>
                  <include>**/*TestCase.java</include>
                </includes>
              </configuration>
            </execution>
          </executions>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-enforcer-plugin</artifactId>
          <version>1.1</version>
        </plugin>

      </plugins>

    </pluginManagement>

    <plugins>

      <!-- Install test jar -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>test-jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <!-- Install sources -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <!-- Avoid issues with signature plugin -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <configuration>
          <mavenExecutorId>forked-path</mavenExecutorId>
        </configuration>
      </plugin>

    </plugins>
  </build>

  <profiles>

    <profile>
      <id>release</id>
      <activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>
      <build>
        <plugins>
          <!-- Release with Java 6 -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-enforcer-plugin</artifactId>
            <executions>
              <execution>
                <id>enforce-java</id>
                <goals>
                  <goal>enforce</goal>
                </goals>
                <configuration>
                  <rules>
                    <requireJavaVersion>
                      <message>You must release with Java 6!</message>
                      <version>[1.6,1.8)</version>
                    </requireJavaVersion>
                  </rules>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>repo</id>
      <activation>
        <property>
          <name>!repo</name>
        </property>
      </activation>
      <repositories>
        <repository>
          <id>repository.jboss.org</id>
          <url>http://repository.jboss.org/maven2</url>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
        </repository>
        <repository>
          <id>maven2-repository.dev.java.net</id>
          <url>http://download.java.net/maven/2/</url>
        </repository>
        <repository>
          <id>repository.exoplatform.org</id>
          <url>http://repository.exoplatform.org/public</url>
        </repository>
      </repositories>

      <pluginRepositories>
        <pluginRepository>
          <id>repository.exoplatform.org</id>
          <url>http://repository.exoplatform.org/public</url>
        </pluginRepository>
      </pluginRepositories>
    </profile>

    <!--
      |  Main profile
      |  used to test easily CRaSH
      |  to use it "mvn test -Pmain", used mainly in shell/core, shell/telnet, shell/ssh and jcr modules
      |  export MAVEN_OPTS="-Xmx512m -XX:MaxPermSize=128m -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005"
      -->
    <profile>
      <id>main</id>
      <dependencies>
        <dependency>
          <groupId>com.sun</groupId>
          <artifactId>tools</artifactId>
          <version>1.6</version>
          <scope>system</scope>
          <systemPath>${tools.jar}</systemPath>
        </dependency>
      </dependencies>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <artifactId>maven-surefire-plugin</artifactId>
              <executions>
                <execution>
                  <id>default-test</id>
                  <configuration>
                    <skip>true</skip>
                  </configuration>
                </execution>
              </executions>
            </plugin>
            <plugin>
              <groupId>org.codehaus.mojo</groupId>
              <artifactId>exec-maven-plugin</artifactId>
              <executions>
                <execution>
                  <id>default-java</id>
                  <goals>
                    <goal>java</goal>
                  </goals>
                  <phase>test</phase>
                  <configuration>
                    <mainClass>org.crsh.standalone.CRaSH</mainClass>
                    <classpathScope>test</classpathScope>
                    <arguments>
                      <argument>--property</argument>
                      <argument>crash.vfs.refresh_period=1</argument>
                    </arguments>
                  </configuration>
                </execution>
              </executions>
            </plugin>
          </plugins>
        </pluginManagement>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>sign-artifacts</id>
      <build>
        <plugins>
          <!-- We want to sign the artifact, the POM, and all attached artifacts -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <executions>
              <execution>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>java8</id>
      <activation>
        <jdk>1.8</jdk>
      </activation>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-javadoc-plugin</artifactId>
              <configuration>
                <!-- Java 8 validation -->
                <additionalparam>-Xdoclint:none</additionalparam>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>

  </profiles>

</project>