<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>
    <groupId>com.cloudhopper</groupId>
    <artifactId>ch-maven-parent-oss</artifactId>
    <packaging>pom</packaging>
    <version>1.2</version>
    <name>ch-maven-parent-oss</name>
    <description>Parent maven pom for opensource cloudhopper projects</description>
    <url>https://github.com/twitter/cloudhopper-maven-parent-oss</url>
    <inceptionYear>2012</inceptionYear>
    
    <organization>
        <name>Cloudhopper by Twitter</name>
        <url>http://github.com/cloudhopper</url>
    </organization>
    
    <scm>
        <url>https://github.com/twitter/cloudhopper-maven-parent-oss</url>
        <connection>scm:git:https://github.com/twitter/cloudhopper-maven-parent-oss.git</connection>
      <tag>version-1.2</tag>
  </scm>
    
    <prerequisites>
        <maven>3.0.3</maven>
    </prerequisites>
    
    <licenses>
        <license>
            <name>Apache 2</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <email>opensource@twitter.com</email>
        </developer>
        <developer>
            <name>Joe Lauer</name>
            <properties>
                <twitter>@jjlauer</twitter>
            </properties>
        </developer>
    </developers>

    <distributionManagement>
        <snapshotRepository>
            <id>sonatype-nexus-snapshots</id>
            <name>Sonatype OSS Snapshots Repository</name>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>sonatype-nexus-staging</id>
            <name>Sonatype OSS Release Staging Repository</name>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
        </repository>
    </distributionManagement>

    <build>
        <defaultGoal>install</defaultGoal>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>buildnumber-maven-plugin</artifactId>
                <version>1.1</version>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>create</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <getRevisionOnlyOnce>false</getRevisionOnlyOnce>
                    <shortRevisionLength>8</shortRevisionLength>
                    <doCheck>false</doCheck>
                    <doUpdate>false</doUpdate>
                    <timestampFormat>{0,date,yyyyMMdd}</timestampFormat>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>1.7</version>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>${project.build.directory}/generated-sources/versioning</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>1.3</version>
                <configuration>
                    <verbose>false</verbose>
                    <addSvnKeyWords>false</addSvnKeyWords>
                    <licenseName>apache_v2</licenseName>
                    <skipUpdateLicense>${license.skip}</skipUpdateLicense>
                    <excludes>
                        <exclude>**/Version.java</exclude>
                    </excludes>
                </configuration>
                <executions>
                    <execution>
                        <id>first</id>
                        <phase>process-sources</phase>
                        <goals>
                            <goal>update-file-header</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.5.1</version>
                <configuration>
                    <debug>true</debug>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <tagNameFormat>version-@{project.version}</tagNameFormat>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.2</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.4</version>
                <configuration>
                    <archive>
                        <manifestEntries>
                            <Specification-Title>${project.name}</Specification-Title>
                            <Specification-Version>${project.version}</Specification-Version>
                            <Specification-Vendor>${project.organization.name}</Specification-Vendor>
                            <Implementation-Title>${project.name}</Implementation-Title>
                            <Implementation-Version>${project.version}</Implementation-Version>
                            <Implementation-Vendor>${project.organization.name}</Implementation-Vendor>
                            <Implementation-Build>${implementation.build}</Implementation-Build>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>${exec-maven-plugin.version}</version>
                <configuration>
                    <classpathScope>test</classpathScope>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>java</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>netbeans-freeform-maven-plugin</artifactId>
                <version>${netbeans-freeform-maven-plugin.version}</version>
                <configuration>
                    <additionalGoals>source:jar</additionalGoals>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-eclipse-plugin</artifactId>
                <version>${maven-eclipse-plugin.version}</version>
                <configuration>
                    <downloadSources>true</downloadSources>
                    <downloadJavadocs>true</downloadJavadocs>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-clean-plugin</artifactId>
                <version>2.5</version>
                <configuration>
                    <filesets>
                        <fileset>
                            <directory>${project.build.outputDirectory}</directory>
                        </fileset>
                        <fileset>
                            <directory>build</directory>
                        </fileset>
                    </filesets>
                </configuration>
            </plugin>
            <!-- generate Version.java automatically (but only if main.java.package is set) -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.3</version>
                <dependencies>
                    <dependency>
                        <groupId>ant-contrib</groupId>
                        <artifactId>ant-contrib</artifactId>
                        <version>1.0b3</version>
                        <exclusions>
                            <exclusion>
                                <groupId>ant</groupId>
                                <artifactId>ant</artifactId>
                            </exclusion>
                        </exclusions>
                    </dependency>
                    <dependency>
                        <groupId>ant</groupId>
                        <artifactId>ant-nodeps</artifactId>
                        <version>1.6.5</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <phase>generate-sources</phase>
                        <configuration>
                            <tasks>
                                <taskdef resource="net/sf/antcontrib/antcontrib.properties" classpathref="maven.plugin.classpath" />
                                <property name="package.name" value="${main.java.package}" />
                                <property name="realsrc.dir" value="${project.build.sourceDirectory}" />
                                <property name="src.dir" value="${project.build.directory}/generated-sources/versioning" />
                                <propertyregex property="package.dir" input="\${package.name}" defaultValue="" regexp="\." replace="/" casesensitive="false" override="true" />
                                <property name="build.timestamp" value="${maven.build.timestamp}" />
                                <property name="build.version" value="${project.version}" />
                                <property name="build.name" value="${project.artifactId}" />
                                <property name="build.vendor" value="${project.groupId}" />
                                <if>
                                    <equals arg1="${package.name}" arg2="" />
                                    <then>
                                        <echo message="#######################################################################################" />
                                        <echo message="The value of property package.name is not set: set main.java.package property in maven!" />
                                        <echo message="#######################################################################################" />
                                    </then>
                                    <else>
                                        <!-- delete the old way Version.java was created in the main source dir -->
                                        <if>
                                            <available file="${realsrc.dir}/${package.dir}/Version.java" />
                                            <then>
                                                <echo message="The legacy way of creating Version.java detected!" />
                                                <echo message="If you want this file then comment out main.java.package property!" />
                                                <echo message="Deleting file: ${realsrc.dir}/${package.dir}/Version.java" />
                                                <delete file="${realsrc.dir}/${package.dir}/Version.java" />
                                            </then>
                                        </if>
                                        <!-- create generated version -->
                                        <mkdir dir="${src.dir}/${package.dir}/" />
                                        <echo file="${src.dir}/${package.dir}/Version.java" message="/** DO NOT EDIT THIS FILE. IT IS AUTO GENERATED BY MAVEN */&#xD;&#xA;" />
                                        <echo file="${src.dir}/${package.dir}/Version.java" append="true" message="package ${package.name};&#xD;&#xA;" />
                                        <echo file="${src.dir}/${package.dir}/Version.java" append="true" message="public final class Version {&#xD;&#xA;" />
                                        <echo file="${src.dir}/${package.dir}/Version.java" append="true" message=" private static final String COMMIT=&quot;${buildNumber}&quot;;&#xD;&#xA;" />
                                        <echo file="${src.dir}/${package.dir}/Version.java" append="true" message=" private static final String TIMESTAMP=&quot;${build.timestamp}&quot;;&#xD;&#xA;" />
                                        <echo file="${src.dir}/${package.dir}/Version.java" append="true" message=" private static final String VERSION=&quot;${build.version}&quot;;&#xD;&#xA;" />
                                        <echo file="${src.dir}/${package.dir}/Version.java" append="true" message=" private static final String NAME=&quot;${build.name}&quot;;&#xD;&#xA;" />
                                        <echo file="${src.dir}/${package.dir}/Version.java" append="true" message=" private static final String VENDOR=&quot;${build.vendor}&quot;;&#xD;&#xA;" />
                                        <echo file="${src.dir}/${package.dir}/Version.java" append="true" message=" private static final String LONG_VERSION=&quot;${build.version} (commit ${buildNumber} @ ${build.timestamp})&quot;;&#xD;&#xA;" />
                                        <echo file="${src.dir}/${package.dir}/Version.java" append="true" message=" /** Returns the library source control commit tag such as &quot;${buildNumber}&quot; */&#xD;&#xA;" />
                                        <echo file="${src.dir}/${package.dir}/Version.java" append="true" message=" static public String getCommit() { return COMMIT; }&#xD;&#xA;" />
                                        <echo file="${src.dir}/${package.dir}/Version.java" append="true" message=" /** Returns the library vendor such as &quot;${build.vendor}&quot; */&#xD;&#xA;" />
                                        <echo file="${src.dir}/${package.dir}/Version.java" append="true" message=" static public String getVendor() { return VENDOR; }&#xD;&#xA;" />
                                        <echo file="${src.dir}/${package.dir}/Version.java" append="true" message=" /** Returns the library build timestamp (date) such as &quot;${build.timestamp}&quot; */&#xD;&#xA;" />
                                        <echo file="${src.dir}/${package.dir}/Version.java" append="true" message=" static public String getTimestamp() { return TIMESTAMP; }&#xD;&#xA;" />
                                        <echo file="${src.dir}/${package.dir}/Version.java" append="true" message=" /** Returns the library name such as &quot;${build.name}&quot; */&#xD;&#xA;" />
                                        <echo file="${src.dir}/${package.dir}/Version.java" append="true" message=" static public String getName() { return NAME; }&#xD;&#xA;" />
                                        <echo file="${src.dir}/${package.dir}/Version.java" append="true" message=" /** Returns the library version such as &quot;${build.version}&quot; */&#xD;&#xA;" />
                                        <echo file="${src.dir}/${package.dir}/Version.java" append="true" message=" static public String getVersion() { return VERSION; }&#xD;&#xA;" />
                                        <echo file="${src.dir}/${package.dir}/Version.java" append="true" message=" /** Returns a longer library version that includes the timestamp such as &quot;${build.version} (commit ${buildNumber}; ts ${build.timestamp})&quot; */&#xD;&#xA;" />
                                        <echo file="${src.dir}/${package.dir}/Version.java" append="true" message=" static public String getLongVersion() { return LONG_VERSION; }&#xD;&#xA;" />
                                        <echo file="${src.dir}/${package.dir}/Version.java" append="true" message="}${line.separator}" />
                                    </else>
                                </if>
                            </tasks>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <!-- only sign artificats during release; not snapshots -->
            <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>
                        <version>1.4</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <properties>
        <!-- Maven config -->
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <copyright.year>2012</copyright.year>
        <maven.test.skip>false</maven.test.skip>
        <maven.integration.skip>true</maven.integration.skip>
        <license.skip>false</license.skip>

        <!-- Maven plugin component versions -->
        <maven-release-plugin.version>2.1</maven-release-plugin.version>
        <maven-license-plugin.version>1.9.0</maven-license-plugin.version>
        <exec-maven-plugin.version>1.2</exec-maven-plugin.version>
        <netbeans-freeform-maven-plugin.version>2.0</netbeans-freeform-maven-plugin.version>
        <maven-eclipse-plugin.version>2.8</maven-eclipse-plugin.version>
        
        <!-- 3rd Party library dependency versions -->
        <main.java.package />
        <joda-time.version>[1.6,)</joda-time.version>
        <junit.version>[4.0,)</junit.version>
        <log4j.version>[1.2.13,)</log4j.version>
        <logback.version>[0.9,)</logback.version>
        <netty.version>[3.2,)</netty.version>
        <slf4j.version>[1.5.0,)</slf4j.version>
    </properties>
    
</project>
