<!--
    $Id: pom.xml,v 1.37 2012/01/06 22:39:16 oboehm Exp $

	Project Object Model (POM) for Maven
	If you are behind a proxy try the following command:
		'mvn -Dhttp.proxyHost=10.253.1.158 -Dhttp.proxyPort=8080 validate'
	Instead of 'validate' you can use also another goal. The following goals
	should work (see also iX 2/2006, p.77):
		validate
		generate-sources
		install
	
	Some other useful goals are:
	    jar
	    source:jar
	    source:test-jar
	
	PS: If you want to update the maven plugins use the option -U.

	see http://maven.apache.org/guides/introduction/introduction-to-the-pom.html
	see http://maven.apache.org/pom.htm
	
    (c)reated 22-Mar-09 by ob@aosd.de
	last up$Date: 2012/01/06 22:39:16 $ by $Author: oboehm $
-->

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

  <parent>
    <groupId>org.patterntesting</groupId>
    <artifactId>patterntesting-parent</artifactId>
    <version>1.2.0</version>
    <relativePath>../patterntesting-parent</relativePath>
  </parent>
	
  <!-- 
      The Basics
      must be set if you want to upload it to the Central Repository
      see http://maven.apache.org/guides/mini/guide-central-repository-upload.html
   -->	
  <modelVersion>4.0.0</modelVersion>
  <artifactId>patterntesting-concurrent</artifactId>
  <packaging>jar</packaging>
  <name>patterntesting-concurrent</name>
  <!-- see http://maven.apache.org/pom.html#Licenses -->
  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
    </license>
  </licenses>
  <url>http://patterntesting.org/release/concurrent/</url>

  <inceptionYear>2009</inceptionYear>
  <description>
    PatternTesting Concurrent (patterntesting-concurrent) is a collection
    of useful thread aspects. It has support for testing, for
    sychnronization and for concurrent programming.
    Some of the ideas used in this library comes from reading
    Brian Goetz's book "Java Concurrency in Practice".
  </description>
  
  <scm>
    <connection>scm:cvs:pserver:anonymous@patterntesting.cvs.sourceforge.net:/cvsroot/patterntesting:PatternTesting10/patterntesting-concurrent</connection>
    <url>http://patterntesting.cvs.sourceforge.net/viewvc/patterntesting/PatternTesting10/patterntesting-concurrent/</url>
    <tag>patterntesting-1_1_0</tag>
  </scm>

  <developers>
    <developer>
      <name>Oliver Boehm</name>
      <id>oboehm</id>
      <email>ob@aosd.de</email>
      <url>http://www.aosd.de/</url>
      <organization>agentes AG</organization>
      <organizationUrl>http://www.agentes.de</organizationUrl>
      <roles>
        <role>Java Developer</role>
      </roles>
    </developer>
  </developers>
  
  <distributionManagement>
    <site>
        <id>ftp-patterntesting.org</id>
        <name>PatternTesting Website</name>
        <url>${patterntesting.site.url}/${project.version}/concurrent/</url>
    </site>
  </distributionManagement>
  
  <!-- 
	  L I B R A R I E S
	  see http://www.ibiblio.org/maven2/ for available libraries
   -->
  <dependencies>
    <dependency>
      <groupId>org.patterntesting</groupId>
      <artifactId>patterntesting-rt</artifactId>
    </dependency>
    <dependency>
      <groupId>org.patterntesting</groupId>
      <artifactId>patterntesting-tools</artifactId>
      <scope>test</scope>
    </dependency>
    <!-- needed not only for testing -->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>compile</scope>
    </dependency>
    <!-- Spring -->
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-context</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-test</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <!-- 
      General Properties
      (see parent POM)
   -->
  <properties>
    <patterntesting.site.artifact.dir>${patterntesting.site.dir}/concurrent/</patterntesting.site.artifact.dir>
  </properties> 

  <!-- Build Settings -->
  <build>
    <extensions>
      <!-- Enabling the use of FTP -->
      <extension>
        <groupId>org.apache.maven.wagon</groupId>
         <artifactId>wagon-ftp</artifactId>
      </extension>
    </extensions>
    <plugins>
      <!--
          AspectJ compiler
          @see http://www.mail-archive.com/user@mojo.codehaus.org/msg00157.html
          @see http://mail-archives.apache.org/mod_mbox/maven-users/200601.mbox/%3CB39B8F0E-BB20-44DB-96B3-3C7FCB85B594@gmail.com%3E
          @see http://mojo.codehaus.org/aspectj-maven-plugin/differentTestAndCompile.html
       -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>aspectj-maven-plugin</artifactId>
        <configuration>
          <source>${maven.compile.source}</source>
          <target>${maven.compile.target}</target>
          <complianceLevel>${maven.compile.complianceLevel}</complianceLevel>
          <options>
            <option>-verbose</option>
            <option>-showWeaveInfo</option>             
          </options>
          <ajdtBuildDefFile>build.ajproperties</ajdtBuildDefFile>
          <aspectLibraries>
            <aspectLibrary>
              <groupId>org.patterntesting</groupId>
              <artifactId>patterntesting-rt</artifactId>
            </aspectLibrary>
          </aspectLibraries>
        </configuration>
        <executions>
          <execution>
            <id>compile</id>
            <configuration>
              <ajdtBuildDefFile>build.ajproperties</ajdtBuildDefFile>
            </configuration>
            <goals>
              <goal>compile</goal>
            </goals>
          </execution>
          <execution>
            <id>test-compile</id>
            <configuration>
              <ajdtBuildDefFile>src/test/build.ajproperties</ajdtBuildDefFile>
            </configuration>
            <goals>
              <goal>test-compile</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
	  <!-- see http://maven.apache.org/plugins/maven-surefire-plugin/examples/inclusion-exclusion.html -->
	  <plugin>
	    <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
	  </plugin>
	  <!-- see http://maven.apache.org/plugins/maven-source-plugin/usage.html -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-sources</id>
            <phase>verify</phase>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <!-- 
          provide it as bundle
          see http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html
       -->
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <extensions>true</extensions>
        <configuration>
          <instructions>
            <Import-Package>
              *
            </Import-Package>
            <Export-Package>
              patterntesting.concurrent,
              patterntesting.concurrent.*
            </Export-Package>
            <Private-Package>
              patterntesting.concurrent.experimental,
              patterntesting.concurrent.junit.internal
            </Private-Package>
          </instructions>
        </configuration>
        <executions>
          <execution>
            <id>bundle-manifest</id>
            <phase>process-classes</phase>
            <goals>    
              <goal>manifest</goal>
            </goals>   
          </execution>
        </executions>
      </plugin>
      <!--
          see "Adding OSGi metadata to existing projects without changing the packaging type"
          (http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html)
       -->
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>  
            <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
          </archive> 
        </configuration>
      </plugin>
    </plugins>
  </build>

  <profiles>

    <!-- 
        For local deployment of the reports you need the ${patterntesting.site.dir}.
        This is not on all hosts (e.g. not on the cloudbees host) available.
     -->
    <profile>
      <id>local-site</id>
      <activation>
        <file>
          <exists>${patterntesting.site.dir}</exists>
        </file>
      </activation>
      <build>
        <plugins>
          <!--
              copy reports
              
              ask Ant to do some jobs for us
              @see http://maven.apache.org/plugins/maven-antrun-plugin/usage.html
              @see http://maven.apache.org/settings.html / Properties
           -->
          <plugin>
            <artifactId>maven-antrun-plugin</artifactId>
            <executions>
              <execution>
                <phase>site</phase>
                <configuration>
                  <tasks name="install.reports" description="copy reports to local site">
                    <!--
                      Place any ant task here. You can add anything
                      you can add between <target> and </target> in a
                      build.xml.
                    -->
                    <echo>copying reports...</echo>
                    <copy todir="${patterntesting.site.dir}/concurrent/" verbose="false">
                      <fileset dir="target/site" />
                    </copy>
                  </tasks>
                </configuration>
                <goals>
                  <goal>run</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    
    <!-- 
        If you want an uber JAR with all dependant libs you can use this profile here.
        It is not in the default profile because for patterntesting-rt an uber JAR is
        already generated. This reduces the dependency to "patterntesting-rt-uberjar.jar"
        and "patterntesting-concurrent.jar".
     -->
    <profile>
      <id>uberjar</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-shade-plugin</artifactId>
            <executions>
              <execution>
                <phase>package</phase>
                <goals>
                  <goal>shade</goal>
                </goals>
                <configuration>
                  <shadedArtifactAttached>true</shadedArtifactAttached>
                  <shadedClassifierName>uberjar</shadedClassifierName>
                  <artifactSet>
                    <excludes>
                      <exclude>junit:junit</exclude>
                    </excludes>
                  </artifactSet>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    
  </profiles>

</project>
