<?xml version="1.0" encoding="UTF-8"?>

<!--
  Copyright (c) 2009-2010 WeigleWilczek and others.
  All rights reserved. This program and the accompanying materials
  are made available under the terms of the Eclipse Public License v1.0
  which accompanies this distribution, and is available at
  http://www.eclipse.org/legal/epl-v10.html
-->

<!--
########################################################################################################################
Root POM for ScalaModules
########################################################################################################################
-->

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

  <!--
  ######################################################################################################################
  Basics
  ######################################################################################################################
  -->

  <groupId>org.eclipse.scalamodules</groupId>
  <artifactId>scalamodules-root</artifactId>
  <version>2.0-M2</version>
  <packaging>pom</packaging>

  <!--
  ######################################################################################################################
  More project information
  ######################################################################################################################
  -->

  <name>Root POM for ScalaModules</name>
  <description>ScalaModules is a Scala DSL to ease OSGi development.</description>
  <url>http://www.eclipse.org/scalamodules</url>
  <inceptionYear>2009</inceptionYear>
  <organization>
    <name>WeigleWilczek</name>
    <url>http://www.weiglewilczek.com/</url>
  </organization>
  <licenses>
    <license>
      <name>Eclipse Public License v1.0</name>
      <url>http://www.eclipse.org/legal/epl-v10.html</url>
    </license>
  </licenses>
  <!-- TODO Enter mailing list info -->
  <!--mailingLists>
    <mailingList>
      <name>ScalaModules-</name>
      <post>scalamodules-user@googlegroups.com</post>
      <archive>http://dev.eclipse.org/mailman/listinfo/scalamodules-dev</archive>
    </mailingList>
  </mailingLists-->
  <developers>
    <developer>
      <name>Heiko Seeberger</name>
      <organization>WeigleWilczek</organization>
      <email>heiko.seeberger@googlemail.com</email>
    </developer>
    <developer>
      <name>Roman Roelofsen</name>
      <email>roman.roelofsen@googlemail.com</email>
    </developer>
    <developer>
      <name>Kjetil Valstadsve</name>
      <email>valstadsve@gmail.com</email>
    </developer>
  </developers>

  <!--
  ######################################################################################################################
  Properties
  ######################################################################################################################
  -->

  <properties>

    <!-- Common plugin settings -->
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>${project.build.sourceEncoding}</project.reporting.outputEncoding>
    <maven.compiler.source>1.5</maven.compiler.source>
    <maven.compiler.target>${maven.compiler.source}</maven.compiler.target>

    <!-- Specific settings for ScalaModules -->
    <scala.version>2.8.0.Beta1</scala.version>
    <osgi.version>4.2.0</osgi.version>
    <pax-exam.version>1.2.0</pax-exam.version>
  </properties>

  <!--
  ######################################################################################################################
  Dependencies
  ######################################################################################################################
  -->

  <!-- Just for IntelliJ! Overwrite scope with test where neccessary! -->
  <dependencies>
    <dependency>
      <groupId>org.scala-lang</groupId>
      <artifactId>scala-compiler</artifactId>
      <version>${scala.version}</version>
      <scope>provided</scope>
    </dependency>
  </dependencies>

  <dependencyManagement>
    <dependencies>

      <!-- Compile -->
      <dependency>
        <groupId>org.eclipse.scalamodules</groupId>
        <artifactId>scalamodules-scala-library</artifactId>
        <version>${scala.version}</version>
      </dependency>

      <!-- Provided -->
      <dependency>
        <groupId>org.osgi</groupId>
        <artifactId>org.osgi.core</artifactId>
        <version>${osgi.version}</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>org.osgi</groupId>
        <artifactId>org.osgi.compendium</artifactId>
        <version>${osgi.version}</version>
        <scope>provided</scope>
      </dependency>

      <!-- Test -->
      <dependency>
        <groupId>org.scalatest</groupId>
        <artifactId>scalatest</artifactId>
        <version>1.0.1-for-scala-2.8.0.Beta1-SNAPSHOT</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.scala-tools.testing</groupId>
        <artifactId>specs_2.8.0.Beta1</artifactId>
        <version>1.6.4</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-all</artifactId>
        <version>1.8.4</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.7</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.ops4j.pax.exam</groupId>
        <artifactId>pax-exam</artifactId>
        <version>${pax-exam.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.ops4j.pax.exam</groupId>
        <artifactId>pax-exam-junit</artifactId>
        <version>${pax-exam.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.ops4j.pax.exam</groupId>
        <artifactId>pax-exam-container-default</artifactId>
        <version>${pax-exam.version}</version>
        <scope>test</scope>
      </dependency>
      <!-- An OSGi framework is required to use ScalaModules in the REPL (mvn scala:console) -->
      <dependency>
        <groupId>org.apache.felix</groupId>
        <artifactId>org.apache.felix.framework</artifactId>
        <version>2.0.2</version>
        <scope>test</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <!--
  ######################################################################################################################
  Build
  ######################################################################################################################
  -->

  <build>
    <sourceDirectory>src/main/scala</sourceDirectory>
    <testSourceDirectory>src/test/scala</testSourceDirectory>
    <pluginManagement>
      <plugins>

        <!-- Plugins distributed by Maven (alphabetically sorted) -->
        <plugin>
          <artifactId>maven-clean-plugin</artifactId>
          <version>2.3</version>
        </plugin>
        <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>2.1</version>
        </plugin>
        <plugin>
          <artifactId>maven-dependency-plugin</artifactId>
          <version>2.1</version>
        </plugin>
        <plugin>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>2.5</version>
        </plugin>
        <plugin>
          <artifactId>maven-resources-plugin</artifactId>
          <version>2.4.1</version>
        </plugin>
        <plugin>
          <artifactId>maven-source-plugin</artifactId>
          <version>2.1.1</version>
          <executions>
            <execution>
              <id>attach-sources</id>
              <goals>
                <goal>jar</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.4.3</version>
          <configuration>
            <includes>
              <include>**/*Spec.java</include>
              <include>**/*Test.java</include>
            </includes>
          </configuration>
        </plugin>

        <!-- Plugins distributed by 3rd parties (alphabetically sorted) -->
        <plugin>
          <groupId>org.apache.felix</groupId>
          <artifactId>maven-bundle-plugin</artifactId>
          <version>2.0.1</version>
          <extensions>true</extensions>
          <configuration>
            <instructions>
              <Bundle-RequiredExecutionEnvironment>J2SE-1.5,JavaSE-1.6</Bundle-RequiredExecutionEnvironment>
              <_versionpolicy>[$(@),$(version;=+;$(@)))</_versionpolicy>
            </instructions>
          </configuration>
          <executions>
            <execution>
              <id>create-bundle</id>
              <phase>package</phase>
              <goals>
                <goal>bundle</goal>
              </goals>
            </execution>
            <!--execution>
              <id>bundle-install</id>
              <phase>install</phase>
              <goals>
                <goal>install</goal>
              </goals>
            </execution-->
          </executions>
        </plugin>
        <plugin>
          <groupId>com.google.code.maven-license-plugin</groupId>
          <artifactId>maven-license-plugin</artifactId>
          <version>1.4.0</version>
          <configuration>
            <header>${basedir}/../../../resources/header.txt</header>
            <quiet>false</quiet>
            <failIfMissing>true</failIfMissing>
            <includes>
              <include>src/main/scala/**</include>
              <include>src/test/scala/**</include>
            </includes>
            <excludes>
              <exclude>.git/**</exclude>
              <exclude>**/.gitignore</exclude>
              <exclude>**/.manager/**</exclude>
              <exclude>**/*.css</exclude>
              <exclude>**/*.txt</exclude>
              <exclude>**/*.xhtml</exclude>
              <exclude>**/*.xml</exclude>
            </excludes>
            <useDefaultExcludes>true</useDefaultExcludes>
            <mapping>
              <scala>JAVADOC_STYLE</scala>
            </mapping>
            <useDefaultMapping>true</useDefaultMapping>
            <encoding>UTF-8</encoding>
          </configuration>
          <executions>
            <execution>
              <id>format-headers</id>
              <phase>process-sources</phase>
              <goals>
                <goal>format</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.ops4j.pax.exam</groupId>
          <artifactId>maven-paxexam-plugin</artifactId>
          <version>${pax-exam.version}</version>
          <!--configuration>
            <dependencyScope>compile</dependencyScope>
          </configuration-->
          <executions>
            <execution>
              <id>generate-config</id>
              <goals>
                <goal>generate-config</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.scala-tools</groupId>
          <artifactId>maven-scala-plugin</artifactId>
          <version>2.13.1</version>
          <configuration>
            <scalaVersion>${scala.version}</scalaVersion>
            <charset>${project.build.sourceEncoding}</charset>
            <jvmArgs>
              <jvmArg>-Xmx1024m</jvmArg>
            </jvmArgs>
            <args>
              <arg>-target:jvm-1.5</arg>
              <arg>-make:changed</arg>
              <arg>-deprecation</arg>
              <arg>-unchecked</arg>
              <arg>-optimise</arg>
            </args>
          </configuration>
          <executions>
            <execution>
              <goals>
                <goal>compile</goal>
                <goal>testCompile</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

  <!--
  ######################################################################################################################
  Environment
  ######################################################################################################################
  -->

  <!-- TODO Switch to Eclipe infrastructure as soon as available! -->
  <scm>
    <connection>scm:git:git://github.com/weiglewilczek/scalamodules.git</connection>
    <developerConnection>scm:git:git@github.com:weiglewilczek/scalamodules.git</developerConnection>
    <url>http://github.com/weiglewilczek/scalamodules/tree/master</url>
  </scm>
  <issueManagement>
    <system>github</system>
    <url>http://github.com/weiglewilczek/scalamodules/issues/</url>
  </issueManagement>
  <ciManagement>
    <system>Hudson</system>
    <url>http://hudson.scala-tools.org/job/scalamodules/</url>
  </ciManagement>
  <distributionManagement>
    <repository>
      <id>nexus.scala-tools.org</id>
      <url>http://nexus.scala-tools.org/content/repositories/releases</url>
    </repository>
    <snapshotRepository>
      <id>nexus.scala-tools.org</id>
      <url>http://nexus.scala-tools.org/content/repositories/snapshots</url>
      <uniqueVersion>true</uniqueVersion>
    </snapshotRepository>
  </distributionManagement>
  <repositories>
    <repository>
      <id>scala-tools.releases</id>
      <name>Scala-Tools Dependencies Repository for Releases</name>
      <url>http://scala-tools.org/repo-releases</url>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
    <repository>
      <id>scala-tools.snapshots</id>
      <name>Scala-Tools Dependencies Repository for Snapshots</name>
      <url>http://scala-tools.org/repo-snapshots</url>
      <releases>
        <enabled>false</enabled>
      </releases>
    </repository>
    <repository>
      <id>opsj4.releases</id>
      <url>http://repository.ops4j.org/maven2</url>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
    <repository>
      <id>opsj4.snapshots</id>
      <url>http://repository.ops4j.org/mvn-snapshots</url>
      <releases>
        <enabled>false</enabled>
      </releases>
    </repository>
  </repositories>

</project>
