
<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>it.tidalwave.thesefoolishthings</groupId>
    <artifactId>superpom</artifactId>
    <packaging>pom</packaging>
    <version>1.0.4</version>
    <name>TheseFoolishThings - SuperPOM</name>
    <url>http://thesefoolishthings.kenai.com</url>
    <description>TheseFoolishThings</description>
    <organization>
        <name>Tidalwave s.a.s.</name>
        <url>http://www.tidalwave.it</url>
    </organization>
    <inceptionYear>2010</inceptionYear>

    <developers>
        <developer>
            <name>Fabrizio Giudici</name>
            <email>fabrizio.giudici@tidalwave.it</email>
            <url>http://www.tidalwave.it/people</url>
            <organization>Tidalwave s.a.s.</organization>
            <organizationUrl>http://www.tidalwave.it</organizationUrl>
            <roles>
                <role>manager</role>
                <role>developer</role>
            </roles>
            <timezone>+1</timezone>
        </developer>
    </developers>

    <licenses>
        <license>
            <name>Apache-2.0</name>
            <url>http://www.opensource.org/licenses/apache2.0.php</url>
            <comments>Apache License 2.0</comments>
        </license>
    </licenses>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <bundle.namespace>${pom.groupId}.${pom.artifactId}</bundle.namespace>
        <testReportsDirectory>${project.build.directory}/surefire-reports/plain</testReportsDirectory>
        <staging.mvn.repo.url>file://${project.build.directory}/target-maven-repo</staging.mvn.repo.url>
        <buildNumber>unknown</buildNumber>
        <buildNumberSep>.</buildNumberSep>
        <testFailureIgnore>false</testFailureIgnore>
        <revision.stamp>.revision</revision.stamp>
        <breakBuildOnIncompatibleAPIChanges>false</breakBuildOnIncompatibleAPIChanges>
        <disableJavaDocs>false</disableJavaDocs>
        <disableDeploy>false</disableDeploy>
        <scm.repo.effective.url>${scm.repo.url}</scm.repo.effective.url>
    </properties>

    <scm>
        <connection>scm:hg:${scm.repo.readonly.url}</connection>
        <developerConnection>scm:hg:${scm.repo.effective.url}</developerConnection>
        <url>${scm.repo.browse.url}</url>
    </scm>

    <repositories>
        <repository>
            <id>snapshots-oss.sonatype.org</id>
            <name>Sonatype Snapshots Repository</name>
            <url>http://oss.sonatype.org/content/repositories/snapshots/</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>

    <distributionManagement>
        <repository>
            <id>staging-oss.sonatype.org</id>
            <name>SonaType Release Repository</name>
            <url>dav:http://oss.sonatype.org/service/local/staging/deploy/maven2</url>
        </repository>
        <snapshotRepository>
            <id>snapshots-oss.sonatype.org</id>
            <name>SonaType Snapshot Repository</name>
            <url>http://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <dependencyManagement>
        <dependencies>
            <!--==== Testing ======================================================================================-->
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.7</version>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-all</artifactId>
                <version>1.8.2</version>
            </dependency>
            <dependency>
                <groupId>org.hamcrest</groupId>
                <artifactId>hamcrest-library</artifactId>
                <version>1.1</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <extensions>
            <extension>
                <groupId>org.apache.maven.wagon</groupId>
                <artifactId>wagon-webdav-jackrabbit</artifactId>
                <version>1.0-beta-5</version>
            </extension>
        </extensions>

        <!-- For buildNumber to be properly evaluated by assembly:assembly, use also the validate goal -->
        <finalName>${project.artifactId}-${project.version}${buildNumberSep}${buildNumber}</finalName>

        <!-- ***********************************************************************************************************
        *
        * We want reproducible builds, so all Maven plugins have explicit version numbers.
        *
        ************************************************************************************************************ -->
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>2.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <!-- 2.6 and 2.6.1 are broken -->
                    <version>2.5</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>2.2-beta-5</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.5</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-pmd-plugin</artifactId>
                    <version>2.4</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <version>2.5</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <version>1.3</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-release-plugin</artifactId>
                    <version>2.0-beta-9</version>
                </plugin>

                <!--
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>buildnumber-maven-plugin</artifactId>
                    <version>1.0-beta-3</version>
                </plugin>
-->
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>exec-maven-plugin</artifactId>
                    <version>1.1.1</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>nbm-maven-plugin</artifactId>
                    <version>3.1</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>cobertura-maven-plugin</artifactId>
                    <version>2.3</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>findbugs-maven-plugin</artifactId>
                    <!-- FIXME: 2.3.1 seems to be broken -->
                    <version>2.3</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <version>1.4</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>clirr-maven-plugin</artifactId>
                    <version>2.2.2</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.felix</groupId>
                    <artifactId>maven-bundle-plugin</artifactId>
                    <version>2.0.1</version>
                </plugin>

            </plugins>
        </pluginManagement>

        <!-- ***********************************************************************************************************
        *
        *
        *
        ************************************************************************************************************ -->
        <plugins>
            <!-- Compiler -->
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <debug>true</debug>
                    <optimize>true</optimize>
                    <source>1.6</source>
                    <target>1.6</target>
                    <showDeprecation>true</showDeprecation>
                    <showWarnings>true</showWarnings>
                    <!-- Workaround for http://jira.codehaus.org/browse/MCOMPILER-98 -->
                    <compilerArguments>
                        <sourcepath>${project.basedir}/src/main/java</sourcepath>
                    </compilerArguments>
                </configuration>
            </plugin>

            <!-- Assembler to produce final artifacts. -->
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <configuration>
                    <tarLongFileMode>gnu</tarLongFileMode>
                    <runOnlyAtExecutionRoot>true</runOnlyAtExecutionRoot>
                    <descriptors>
                        <descriptor>src/assemble/bin.xml</descriptor>
                        <descriptor>src/assemble/project.xml</descriptor>
                    </descriptors>
                </configuration>
            </plugin>

            <!-- Retrieves the 4th build number from Subversion revision. -->
<!--
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>buildnumber-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>create</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <doCheck>false</doCheck>
                    <doUpdate>false</doUpdate>
                </configuration>
            </plugin>
-->
            <!-- Executes tests -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <reportsDirectory>${testReportsDirectory}</reportsDirectory>
                    <includes>
                        <include>**/*Test.java</include>
                    </includes>
                    <!-- systemProperties>
                        <property>
                        </property>
                    </systemProperties -->
                    <argLine>-Xmx768M</argLine>
                    <testFailureIgnore>${testFailureIgnore}</testFailureIgnore>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <useDefaultManifestFile>true</useDefaultManifestFile> <!-- required since nbm-plugin 3.0-->
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>jar</goal>
                            <goal>test-jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <configuration>
                    <skip>${disableDeploy}</skip>
                </configuration>
            </plugin>

            <!-- Configures the release process, calling the assembly to include extra artifacts in deploy -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <configuration>
                    <preparationGoals>clean install verify</preparationGoals>
                    <goals>clean install javadoc:javadoc assembly:assembly deploy</goals>
                    <arguments>-Prelease -DaltDeploymentRepository="${altDeploymentRepository}"</arguments>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>nbm-maven-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <descriptor>src/main/nbm/module.xml</descriptor>
                    <brandingToken>${netbeans.brandingToken}</brandingToken>
                    <cluster>${netbeans.cluster}</cluster>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>clirr-maven-plugin</artifactId>
                <configuration>
                    <failOnError>${breakBuildOnIncompatibleAPIChanges}</failOnError>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>metrics</id>
            <properties>
                <testReportsDirectory>${project.build.directory}/surefire-reports/cobertura</testReportsDirectory>
            </properties>
            <build>
                <plugins>
                    <!-- Cobertura -->
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>cobertura-maven-plugin</artifactId>
                        <configuration>
                            <formats>
                                <format>xml</format>
                                <format>html</format>
                            </formats>
                        </configuration>
                        <executions>
                            <execution>
                                <phase>package</phase>
                                <goals>
                                    <goal>cobertura</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>

            <reporting>
                <plugins>
                    <!-- FindBugs -->
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>findbugs-maven-plugin</artifactId>
                        <configuration>
                            <xmlOutput>true</xmlOutput>
                            <findbugsXmlOutput>true</findbugsXmlOutput>
                            <findbugsXmlWithMessages>true</findbugsXmlWithMessages>
                            <effort>Max</effort>
                            <threshold>Low</threshold>
                            <failOnError>false</failOnError>
                        </configuration>
                    </plugin>

                    <!-- PMD -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-pmd-plugin</artifactId>
                        <configuration>
                            <linkXref>true</linkXref>
                            <sourceEncoding>utf-8</sourceEncoding>
                            <minimumTokens>100</minimumTokens>
                            <targetJdk>1.6</targetJdk>
                        </configuration>
                    </plugin>

                    <!-- CheckStyle -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-checkstyle-plugin</artifactId>
                        <configuration>
                            <configLocation>config/sun_checks.xml</configLocation>
                        </configuration>
                    </plugin>
                </plugins>
            </reporting>
        </profile>

        <profile>
            <id>release</id>
            <properties>
                <buildNumber />
                <buildNumberSep />
                <scm.repo.effective.url>file://${project.build.directory}/dummy-hg-repo</scm.repo.effective.url>
                <skipTests>true</skipTests>
                <altDeploymentRepository>release-repo-hudson::default::${staging.mvn.repo.url}</altDeploymentRepository>
            </properties>

            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>exec-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>clean-release-dirs</id>
                                <phase>initialize</phase>
                                <goals>
                                    <goal>exec</goal>
                                </goals>
                                <inherited>false</inherited>
                                <configuration>
                                    <executable>rm</executable>
                                    <arguments>
                                        <argument>-rf</argument>
                                        <argument>${project.build.directory}/dummy-hg-repo</argument>
                                        <argument>${project.build.directory}/target-maven-repo</argument>
                                    </arguments>
                                </configuration>
                            </execution>
                            <execution>
                                <id>create-release-dirs</id>
                                <phase>initialize</phase>
                                <goals>
                                    <goal>exec</goal>
                                </goals>
                                <inherited>false</inherited>
                                <configuration>
                                    <executable>mkdir</executable>
                                    <arguments>
                                        <argument>-p</argument>
                                        <argument>${project.build.directory}/dummy-hg-repo</argument>
                                        <!-- FIXME: strangely the effective POM contains the artifactId -->
                                        <argument>${project.build.directory}/dummy-hg-repo/${artifactId}</argument>
                                    </arguments>
                                </configuration>
                            </execution>
                            <execution>
                                <id>init-dummy-hg-repo</id>
                                <phase>initialize</phase>
                                <goals>
                                    <goal>exec</goal>
                                </goals>
                                <inherited>false</inherited>
                                <configuration>
                                    <executable>hg</executable>
                                   <!-- FIXME: strangely the effective POM contains the artifactId -->
                                    <workingDirectory>${project.build.directory}/dummy-hg-repo/${artifactId}</workingDirectory>
                                    <arguments>
                                        <argument>init</argument>
                                    </arguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>release-sign-artifacts</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>generate-revision-id</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>exec-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>create-id</id>
                                <phase>initialize</phase>
                                <goals>
                                    <goal>exec</goal>
                                </goals>
                                <configuration>
                                    <executable>hg</executable>
                                    <arguments>
                                        <argument>log</argument>
                                        <argument>--limit</argument>
                                        <argument>1</argument>
                                        <argument>--template</argument>
                                        <argument>REVISION: {tags} {node|short}\n</argument>
                                    </arguments>
                                    <outputFile>${revision.stamp}</outputFile>
                                </configuration>
                            </execution>
                            <execution>
                                <id>show-revision</id>
                                <phase>initialize</phase>
                                <goals>
                                    <goal>exec</goal>
                                </goals>
                                <configuration>
                                    <executable>hg</executable>
                                    <arguments>
                                        <argument>log</argument>
                                        <argument>--limit</argument>
                                        <argument>1</argument>
                                        <argument>--template</argument>
                                        <argument>REVISION: {tags} {node|short}\n</argument>
                                    </arguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>show-revision-id</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>exec-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>show-revision</id>
                                <phase>initialize</phase>
                                <goals>
                                    <goal>exec</goal>
                                </goals>
                                <configuration>
                                    <executable>cat</executable>
                                    <arguments>
                                        <argument>${revision.stamp}</argument>
                                    </arguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>release-commit</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>exec-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>push-hg</id>
                                <phase>initialize</phase>
                                <goals>
                                    <goal>exec</goal>
                                </goals>
                                <inherited>false</inherited>
                                <configuration>
                                    <executable>hg</executable>
                                    <arguments>
                                        <argument>push</argument>
                                    </arguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>wagon-maven-plugin</artifactId>
                        <configuration>
                            <source>${staging.mvn.repo.url}</source>
                            <target>${project.distributionManagement.repository.url}</target>
                            <targetId>${project.distributionManagement.repository.id}</targetId>
                        </configuration>
                        <executions>
                            <execution>
                                <id>merge-repo</id>
                                <phase>initialize</phase>
                                <goals>
                                    <goal>merge-maven-repos</goal>
                                </goals>
                                <inherited>false</inherited>
                            </execution>
                        </executions>
                    </plugin>

                </plugins>
            </build>
        </profile>

        <profile>
            <id>release-cancel</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>exec-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>strip-hg</id>
                                <phase>initialize</phase>
                                <goals>
                                    <goal>exec</goal>
                                </goals>
                                <inherited>false</inherited>
                                <configuration>
                                    <!-- FIXME: would be better to strip local changes -->
                                    <executable>rm</executable>
                                    <arguments>
                                        <argument>-rf</argument>
                                        <argument>.hg</argument>
                                    </arguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>deploy-extra-artifacts</id>
            <properties>
                <buildNumber />
                <buildNumberSep />
                <altDeploymentRepository>release-repo-hudson::default::${staging.mvn.repo.url}</altDeploymentRepository>
            </properties>
            <build>
                <plugins>
                    <!-- Attaches the extra artifacts prepared during the release process by the assembly plugin -->
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>build-helper-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-artifacts</id>
                                <inherited>false</inherited>
                                <phase>initialize</phase>
                                <goals>
                                    <goal>attach-artifact</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <artifacts>
                                <artifact>
                                    <file>${project.build.directory}/${project.build.finalName}-project.tar.gz</file>
                                    <type>tar.gz</type>
                                    <classifier>project</classifier>
                                </artifact>
                                <artifact>
                                    <file>${project.build.directory}/${project.build.finalName}-bin.tar.gz</file>
                                    <type>tar.gz</type>
                                    <classifier>bin</classifier>
                                </artifact>
                            </artifacts>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <configuration>
                    <docfilessubdirs>true</docfilessubdirs>
                    <excludePackageNames>*.impl:*.impl.*</excludePackageNames>
                    <doclet>org.umlgraph.doclet.UmlGraphDoc</doclet>
                    <docletArtifact>
                        <groupId>org.umlgraph</groupId>
                        <artifactId>doclet</artifactId>
                        <version>5.1</version>
                    </docletArtifact>
                    <additionalparam>-views -attributes -operations -types -postfixpackage -nodefontpackagesize 6 -nodefontclasssize 8 -nodefontsize 7 -edgefontsize 7 -nodesep 0.05 -ranksep 0.1 -visibility -inferdep -inferrel -inferdepinpackage -hide java.*|javax.*</additionalparam>
                    <useStandardDocletOptions>true</useStandardDocletOptions> 
                    <skip>${disableJavaDocs}</skip>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>clirr-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </reporting>

</project>


