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

  <groupId>org.reflext</groupId>
  <artifactId>reflext.parent</artifactId>
  <version>1.1.0-beta6</version>
  <packaging>pom</packaging>

  <name>Reflext Framework</name>
  <description>The Reflext project provides an abstraction over various Java reflection model and provides advanced operations that are not covered by the existing models</description>
  <url>http://reflext.googlecode.com/</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>

  <developers>
    <developer>
      <id>julien.viet</id>
      <name>Julien Viet</name>
      <email>julien.viet@exoplatform.com</email>
      <roles>
        <role>Owner</role>
      </roles>
    </developer>
    <developer>
      <id>aheritier</id>
      <name>Arnaud Heritier</name>
      <email>arnaud.heritier@exoplatform.com</email>
      <roles>
        <role>Committer</role>
      </roles>
    </developer>
  </developers>

  <scm>
    <connection>scm:svn:http://reflext.googlecode.com/svn/tags/1.1.0-beta6</connection>
    <developerConnection>scm:svn:https://reflext.googlecode.com/svn/tags/1.1.0-beta6</developerConnection>
    <url>http://code.google.com/p/reflext/source/browse/tags/1.1.0-beta6</url>
  </scm>

  <distributionManagement>
    <repository>
      <id>repository.exoplatform.org</id>
      <url>${reflext.releases.repo.url}</url>
    </repository>
    <snapshotRepository>
      <id>repository.exoplatform.org</id>
      <url>${reflext.snapshots.repo.url}</url>    
    </snapshotRepository>
  </distributionManagement>

  <properties>
    <!-- Repositories URLs -->
    <reflext.releases.repo.url>http://repository.exoplatform.org/service/local/staging/deploy/maven2/</reflext.releases.repo.url>
    <reflext.snapshots.repo.url>http://repository.exoplatform.org/content/repositories/reflext-snapshots/</reflext.snapshots.repo.url>
  
    <!-- Plugins settings -->

    <!-- Cross plugins settings -->
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

    <!-- maven-compiler-plugin -->
    <maven.compiler.target>1.5</maven.compiler.target>
    <maven.compiler.source>1.5</maven.compiler.source>

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

  <dependencyManagement>
    <!-- Versions of dependencies have to be the same in all modules -->
    <!-- With that we never define versions in sub-modules -->
    <dependencies>
      <!-- Internal deps -->
      <dependency>
        <groupId>org.reflext</groupId>
        <artifactId>reflext.api</artifactId>
        <version>1.1.0-beta6</version>
      </dependency>
      <dependency>
        <groupId>org.reflext</groupId>
        <artifactId>reflext.apt</artifactId>
        <version>1.1.0-beta6</version>
      </dependency>
      <dependency>
        <groupId>org.reflext</groupId>
        <artifactId>reflext.core</artifactId>
        <version>1.1.0-beta6</version>
      </dependency>
      <dependency>
        <groupId>org.reflext</groupId>
        <artifactId>reflext.jlr</artifactId>
        <version>1.1.0-beta6</version>
      </dependency>
      <dependency>
        <groupId>org.reflext</groupId>
        <artifactId>reflext.spi</artifactId>
        <version>1.1.0-beta6</version>
      </dependency>
      <dependency>
        <groupId>org.reflext</groupId>
        <artifactId>reflext.test-java5</artifactId>
        <version>1.1.0-beta6</version>
      </dependency>
      <dependency>
        <groupId>org.reflext</groupId>
        <artifactId>reflext.test-java6</artifactId>
        <version>1.1.0-beta6</version>
      </dependency>
      <!-- External deps -->
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>3.8</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>1.5.8</version>
      </dependency>

    </dependencies>
  </dependencyManagement>

  <build>
    <pluginManagement>
      <!-- All plugins versions have to be set -->
      <!-- Plugins are sorted by shortname : clean, deploy, ... -->
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-clean-plugin</artifactId>
          <version>2.3</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-checkstyle-plugin</artifactId>
          <version>2.4</version>
        </plugin>
        <plugin>
          <groupId>com.atlassian.maven.plugins</groupId>
          <artifactId>maven-clover2-plugin</artifactId>
          <version>2.6.3</version>
        </plugin>        
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>cobertura-maven-plugin</artifactId>
          <version>2.3</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>2.0.2</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>2.4</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-enforcer-plugin</artifactId>
          <version>1.0-beta-1</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>findbugs-maven-plugin</artifactId>
          <version>2.3</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-gpg-plugin</artifactId>
          <version>1.1</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-install-plugin</artifactId>
          <version>2.3</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>2.3</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <!-- Too many issues with 2.6 versions -->
          <version>2.5</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-pmd-plugin</artifactId>
          <version>2.4</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <version>2.0-beta-9</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-resources-plugin</artifactId>
          <version>2.4.1</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-site-plugin</artifactId>
          <version>2.0.1</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>sonar-maven-plugin</artifactId>
          <version>1.0-beta-1</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>2.1.1</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.4.3</version>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
            <source>1.5</source>
            <target>1.5</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <configuration>
          <mavenExecutorId>forked-path</mavenExecutorId>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <profiles>

    <profile>
      <!-- Only some modules are built with Java 1.5 -->
      <id>Java5</id>
      <activation>
        <jdk>1.5</jdk>
      </activation>
      <modules>
        <module>api</module>
        <module>spi</module>
        <module>jlr</module>
        <module>core</module>
        <module>test-java5</module>
        <module>test</module>
      </modules>
    </profile>

    <profile>
      <!-- All modules are built with Java 6 -->
      <id>Java6</id>
      <activation>
        <jdk>1.6</jdk>
      </activation>
      <modules>
        <module>api</module>
        <module>spi</module>
        <module>jlr</module>
        <module>core</module>
        <module>apt</module>
        <module>test-java5</module>
        <module>test-java6</module>
        <module>test</module>
      </modules>
    </profile>

    <profile>
      <!-- Ensure our build is following some maven best practices and the environment is following some constraints -->
      <!-- Controls can be inactivated by adding -P-enforce or -Dskip-enforce in the command line -->
      <id>enforce</id>
      <activation>
        <property>
          <name>!skip-enforce</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-enforcer-plugin</artifactId>
            <executions>
              <execution>
                <id>enforce-plugin-versions</id>
                <goals>
                  <goal>enforce</goal>
                </goals>
                <configuration>
                  <rules>
                    <requireJavaVersion>
                      <message>Reflext requires at least Java 1.5 to build.</message>
                      <version>1.5</version>
                    </requireJavaVersion>
                    <requirePluginVersions>
                      <message>Best practice is to always define plugin versions!</message>
                      <banLatest>true</banLatest>
                      <banRelease>true</banRelease>
                      <phases>deploy,site</phases>
                    </requirePluginVersions>
                    <requireMavenVersion>
                      <!-- Version 2.0.9 started specifying default versions for all core plugins in the super pom. -->
                      <version>2.0.9</version>
                    </requireMavenVersion>
                  </rules>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <!-- Generation of a jar containing the source code -->
      <!-- Generation can be inactivated by adding -P-sources or -Dskip-sources in the command line -->
      <id>sources</id>
      <activation>
        <property>
          <name>!skip-sources</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <!-- This profile is used when we are doing a release -->
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </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>

  </profiles>

</project>
