<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>com.projectdarkstar</groupId>
  <artifactId>sgs</artifactId>
  <name>Project Darkstar Master POM</name>
  <packaging>pom</packaging>
  <version>12</version>
  <url>http://www.projectdarkstar.com</url>
  <description>
    This is the super POM inherited by all sgs modules
    It defines settings common to all projects
  </description>

  <!-- Require at least Maven version 2.0.9 to build -->
  <prerequisites>
    <maven>2.0.9</maven>
  </prerequisites>

  <build>

    <!-- This section defines global configuration of plugins
	 These plugin settings are not activated in child projects
	 unless the plugin is explicitly used -->
    <pluginManagement>

      <plugins>

	<!-- Default configuration for running unit tests -->
	<plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
	  <version>${surefire.version}</version>
          <configuration>
            <includes>
              <include>**/Test*.java</include>
            </includes>
	    <forkMode>always</forkMode>
	    <failIfNoTests>false</failIfNoTests>
	    <argLine>${test.jvm.args}</argLine>
	    <redirectTestOutputToFile>${test.output.hide}</redirectTestOutputToFile>
          </configuration>
	</plugin>
	
	<!-- A sources jar can be attached by enabling
	     the attach-sources execution id of this plugin -->
	<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>

	<!-- A javadoc jar can be attached by enabling
	     the attach-javadocs execution id of this plugin -->
	<plugin>
	  <groupId>org.apache.maven.plugins</groupId>
	  <artifactId>maven-javadoc-plugin</artifactId>
	  <configuration>
            <links>
              <link>http://java.sun.com/j2se/1.5.0/docs/api/</link>
            </links>
          </configuration>
	  <executions>
	    <execution>
	      <id>attach-javadocs</id>
	      <goals>
		<goal>jar</goal>
	      </goals>
	      <configuration>
		<quiet>true</quiet>
	      </configuration>
	    </execution>
	  </executions>
	</plugin>

	<!-- The resource bundle executions should be activated in modules
	     that produce jars that require the license to be bundled
	     in the jar -->
	<plugin>
	  <groupId>org.apache.maven.plugins</groupId>
	  <artifactId>maven-remote-resources-plugin</artifactId>
	  <configuration>
	    <properties>
	      <projectYear>${projectYear}</projectYear>
	    </properties>
	  </configuration>
	  <executions>
	    <execution>
	      <id>include-gpl-license</id>
	      <goals>
		<goal>process</goal>
	      </goals>
	      <phase></phase>
	      <configuration>
		<resourceBundles>
		  <resourceBundle>com.projectdarkstar.tools.build:sgs-jar-resources-gpl:${sgs-jar-resources-gpl.version}</resourceBundle>
		</resourceBundles>
	      </configuration>
	    </execution>
	    <execution>
	      <id>include-bsd-license</id>
	      <goals>
		<goal>process</goal>
	      </goals>
	      <phase></phase>
	      <configuration>
		<resourceBundles>
		  <resourceBundle>com.projectdarkstar.tools.build:sgs-jar-resources-bsd:${sgs-jar-resources-bsd.version}</resourceBundle>
		</resourceBundles>
	      </configuration>
	    </execution>
	  </executions>
	</plugin>

      </plugins>
      
    </pluginManagement>

    <!-- This section enables plugins globally for all child projects
	 Any project inheriting from this POM will have these plugins
	 enabled and configured as shown unless they override those
	 settings -->
    <plugins>
      
      <!-- Global compiler configuration -->
      <plugin>
	<groupId>org.apache.maven.plugins</groupId>
	<artifactId>maven-compiler-plugin</artifactId>
	<configuration>
	  <compilerArgument>-Xlint</compilerArgument>
	  <source>1.5</source>
	  <target>1.5</target>
	</configuration>
      </plugin>

      <!-- Global manifest generation configuration -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>
            <manifest>
	      <addClasspath>true</addClasspath>
              <addDefaultImplementationEntries>
		true
	      </addDefaultImplementationEntries>
              <addDefaultSpecificationEntries>
		true
	      </addDefaultSpecificationEntries>
            </manifest>
          </archive>
        </configuration>
      </plugin>

      <!-- Configure checkstyle to have custom dependency -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
	<dependencies>
	  <dependency>
	    <groupId>com.projectdarkstar.tools.build</groupId>
	    <artifactId>sgs-build-utilities</artifactId>
	    <version>${sgs-build-utilities.version}</version>
	  </dependency>
	</dependencies>
      </plugin>

    </plugins>

    <!-- Include the wagon-svn extension so we can deploy
	 to Maven2 repositories hosted in SVN repositories
	 on java.net -->
    <extensions>
      <extension>
        <groupId>org.jvnet.wagon-svn</groupId>
        <artifactId>wagon-svn</artifactId>
        <version>RELEASE</version>
      </extension>
    </extensions>

  </build>

  <reporting>
    <plugins>
      
      <!-- Configure checkstyle to run during site lifecycle -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
	<configuration>
	  <linkXRef>false</linkXRef>
	  <consoleOutput>true</consoleOutput>
	  <enableRulesSummary>false</enableRulesSummary>
	  <configLocation>${checkstyle.config}</configLocation>
	  <headerLocation>${checkstyle.header.file}</headerLocation>
	  <packageNamesLocation>
	    ${checkstyle.packageNames}
	  </packageNamesLocation>
	  <propertyExpansion>
	    checkstyle.unusedImports=${checkstyle.unusedImports}
	  </propertyExpansion>
        </configuration>
      </plugin>

      <!-- Configure findbugs to run during site lifecycle -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>findbugs-maven-plugin</artifactId>
	<configuration>
	  <effort>Max</effort>
	  <threshold>Low</threshold>
	  <xmlOutput>true</xmlOutput>
	  <findbugsXmlOutput>true</findbugsXmlOutput>
	  <findbugsXmlWithMessages>true</findbugsXmlWithMessages>
	</configuration>
      </plugin>

    </plugins>
  </reporting>


  <!-- Library of dependencies used in any sub module of this project
       Define versions of dependencies in this file only to maintain
       consistency -->
  <dependencyManagement>
    <dependencies>
      <dependency>
	<groupId>junit</groupId>
	<artifactId>junit</artifactId>
	<version>${junit.version}</version>
	<scope>test</scope>
      </dependency>
      <dependency>
	<groupId>org.easymock</groupId>
	<artifactId>easymock</artifactId>
	<version>${easymock.version}</version>
	<scope>test</scope>
      </dependency>

      <!-- for the sgs-build-utilities -->
      <dependency>
	<groupId>checkstyle</groupId>
	<artifactId>checkstyle</artifactId>
	<version>${checkstyle.version}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <!-- Release artifacts should be deployed to the java.net
       Maven2 repository
       SNAPSHOT artifacts should be deployed to the
       repository hosted in the games-darkstar java.net project -->
  <distributionManagement>
    <repository>
      <id>java.net-maven2-repository</id>
      <name>java.net Maven2 Repository</name>
      <url>java-net:/maven2-repository/trunk/www/repository/</url>
    </repository>
    <snapshotRepository>
      <id>games-darkstar-snapshot-repository</id>
      <name>games-darkstar SNAPSHOT Repository</name>
      <url>java-net:/games-darkstar/trunk/www/snapshots/</url>
      <uniqueVersion>false</uniqueVersion>
    </snapshotRepository>
  </distributionManagement>

  <!-- Include the java.net repository to retrieve dependent
       artifacts (such as wagon-svn) -->
  <repositories>
    <repository>
      <id>java.net</id>
      <name>java.net Maven2 Repository</name>
      <url>http://download.java.net/maven/2/</url>
      <layout>default</layout>
    </repository>
    <repository>
      <id>oracle</id>
      <name>Oracle Maven2 Repository</name>
      <url>http://download.oracle.com/maven</url>
      <layout>default</layout>
    </repository>
  </repositories>
  
  <!-- Configuration properties which should be consistent
       across all children POMS -->
  <properties>
    
    <projectYear>2009</projectYear>
    
    <sgs-build-utilities.version>1.0</sgs-build-utilities.version>
    <sgs-jar-resources-gpl.version>1.0</sgs-jar-resources-gpl.version>
    <sgs-jar-resources-bsd.version>1.0</sgs-jar-resources-bsd.version>

    <junit.version>4.5</junit.version>
    <easymock.version>2.4</easymock.version>

    <checkstyle.version>4.4</checkstyle.version>
    <!-- Locations of checkstyle files
	 Configure these in the individual modules that use the
	 checkstyle plugin -->
    <checkstyle.config>
      com/sun/sgs/tools/checkstyle/darkstar_checks.xml
    </checkstyle.config>
    <checkstyle.header.bsd>
      com/sun/sgs/tools/checkstyle/BSD.txt
    </checkstyle.header.bsd>
    <checkstyle.header.gpl>
      com/sun/sgs/tools/checkstyle/GPLv2.txt
    </checkstyle.header.gpl>
    <checkstyle.header.file>
      ${checkstyle.header.gpl}
    </checkstyle.header.file>
    <checkstyle.packageNames>
      com/sun/sgs/tools/checkstyle/packageNames.xml
    </checkstyle.packageNames>
    <!-- Checkstyle report level for unused imports
	 You can enable the unused imports check by setting the value
	 to warning. -->
    <checkstyle.unusedImports>ignore</checkstyle.unusedImports>

    <surefire.version>2.4.3</surefire.version>

    <test.assertions>-ea:com.sun.sgs...</test.assertions>
    <test.max.heap>-Xmx1g</test.max.heap>
    <test.jvm.args>${test.assertions} ${test.max.heap}</test.jvm.args>
    <test.output.hide>true</test.output.hide>
    <test.bdb.cache.size>1000000</test.bdb.cache.size>

  </properties>

</project>
