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

	<parent>
		<groupId>org.sonatype.oss</groupId>
		<artifactId>oss-parent</artifactId>
		<version>4</version>
	</parent>

	<groupId>com.barchart.udt</groupId>
	<artifactId>barchart-udt4</artifactId>
	<version>1.0.1</version>
	<packaging>jar</packaging>

	<name>barchart-udt</name>

	<description>Java wrapper around native C++ UDT protocol implementation UDT version: 4.8</description>

	<url>http://code.google.com/p/barchart-udt/</url>

	<inceptionYear>2009</inceptionYear>

	<licenses>
		<license>
			<name>The BSD License</name>
			<url>http://www.opensource.org/licenses/bsd-license.php</url>
			<distribution>repo</distribution>
		</license>
	</licenses>

	<properties>

		<maven.build.timestamp.format>yyyy-MM-dd_HH-mm-ss</maven.build.timestamp.format>
		<buildStamp>${maven.build.timestamp}</buildStamp>
		<mavenStamp>ARTIFACT='${artifactId}';VERSION='${version}';TIMESTAMP='${buildStamp}';</mavenStamp>

		<licenceYear>2009-2011</licenceYear>
		<licenceOrganization>Barchart, Inc.</licenceOrganization>
		<licenceWebsite>http://www.barchart.com/</licenceWebsite>
		<licenceDevelopers>Andrei Pozolotin;</licenceDevelopers>

		<moduleUDT>UDT4</moduleUDT>

		<target>${project.build.directory}</target>
		<checkoutUDT>${target}/checkout</checkoutUDT>
		<connectionUDT>scm:cvs:pserver:anonymous:@udt.cvs.sourceforge.net:/cvsroot/udt:${moduleUDT}</connectionUDT>

		<nativeSrc>native</nativeSrc>
		<nativeSrcJNI>${nativeSrc}/jni</nativeSrcJNI>
		<nativeSrcUDT>${nativeSrc}/udt</nativeSrcUDT>
		<nativeLibName>SocketUDT</nativeLibName>
		<nativeInclude>include</nativeInclude>

		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

	</properties>

	<issueManagement>
		<system>google code</system>
		<url>http://code.google.com/p/barchart-udt/issues/list</url>
	</issueManagement>

	<developers>
		<developer>
			<id>andrei.pozolotin</id>
			<name>Andrei Pozolotin</name>
			<roles>
				<role>Project Owner</role>
			</roles>
		</developer>
	</developers>

	<scm>
		<url>http://code.google.com/p/barchart-udt/source/browse/tags/barchart-udt4-1.0.1</url>
		<connection>scm:svn:http://barchart-udt.googlecode.com/svn/tags/barchart-udt4-1.0.1</connection>
		<developerConnection>scm:svn:https://barchart-udt.googlecode.com/svn/tags/barchart-udt4-1.0.1</developerConnection>
	</scm>

	<organization>
		<name>Barchart, Inc.</name>
		<url>http://www.barchart.com</url>
	</organization>


	<build>

		<pluginManagement>
			<plugins>

				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>groovy-maven-plugin</artifactId>
					<version>1.0</version>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-antrun-plugin</artifactId>
					<version>1.6</version>
					<dependencies>
						<dependency>
							<groupId>org.apache.ant</groupId>
							<artifactId>ant</artifactId>
							<version>1.8.1</version>
						</dependency>
						<dependency>
							<groupId>org.apache.ant</groupId>
							<artifactId>ant-nodeps</artifactId>
							<version>1.8.1</version>
						</dependency>
						<dependency>
							<groupId>ant-contrib</groupId>
							<artifactId>cpptasks</artifactId>
							<version>1.0b5</version>
						</dependency>
						<dependency>
							<groupId>ant-contrib</groupId>
							<artifactId>ant-contrib</artifactId>
							<version>1.0b3</version>
						</dependency>
					</dependencies>
				</plugin>

				<plugin>
					<groupId>com.google.code.maven-license-plugin</groupId>
					<artifactId>maven-license-plugin</artifactId>
					<version>1.4.0</version>
				</plugin>

				<plugin>
					<groupId>javolution</groupId>
					<artifactId>colapi</artifactId>
					<version>1.0.0</version>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-resources-plugin</artifactId>
					<version>2.4.3</version>
					<configuration>
						<encoding>UTF-8</encoding>
					</configuration>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-compiler-plugin</artifactId>
					<configuration>
						<source>1.6</source>
						<target>1.6</target>
					</configuration>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-scm-plugin</artifactId>
					<version>1.4</version>
				</plugin>

			</plugins>
		</pluginManagement>

		<plugins>

			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>groovy-maven-plugin</artifactId>
				<executions>
					<execution>
						<id>make-timestamp-property</id>
						<phase>validate</phase>
						<goals>
							<goal>execute</goal>
						</goals>
						<configuration>
							<source>${basedir}/build/script/timestamp.groovy</source>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-antrun-plugin</artifactId>
				<executions>
					<execution>
						<id>generate-version-class</id>
						<phase>generate-sources</phase>
						<goals>
							<goal>run</goal>
						</goals>
						<configuration>
							<tasks>
								<property name="mvn.basedir" value="${basedir}" />
								<property name="mvn.artifactId" value="${artifactId}" />
								<property name="mvn.version" value="${version}" />
								<property name="mvn.timestamp" value="${timestamp}" />
								<property name="mvn.mavenStamp" value="${mavenStamp}" />
								<property name="mvn.buildtime" value="${buildtime}" />
								<property name="mvn.generatedSources" value="${project.build.directory}/generated-sources" />
								<ant antfile="${basedir}/build/script/build-version.ant">
								</ant>
							</tasks>
							<sourceRoot>${project.build.directory}/generated-sources</sourceRoot>
						</configuration>
					</execution>
					<execution>
						<id>report-timestamp-value</id>
						<phase>validate</phase>
						<goals>
							<goal>run</goal>
						</goals>
						<configuration>
							<tasks>
								<echo message="buildtime : ${buildtime}" />
								<echo message="mavenStamp : ${mavenStamp}" />
							</tasks>
						</configuration>
					</execution>
					<execution>
						<id>compile-native</id>
						<phase>compile</phase>
						<goals>
							<goal>run</goal>
						</goals>
						<configuration>
							<tasks>
								<property name="mvn.plugin.classpath" refid="maven.plugin.classpath" />
								<property name="mvn.licenceYear" value="${licenceYear}" />
								<property name="mvn.licenceOrganization" value="${licenceOrganization}" />
								<property name="mvn.licenceWebsite" value="${licenceWebsite}" />
								<property name="mvn.licenceDevelopers" value="${licenceDevelopers}" />
								<property name="mvn.version" value="${version}" />
								<property name="mvn.mavenStamp" value="${mavenStamp}" />
								<property name="mvn.nativeLibName" value="${nativeLibName}" />
								<property name="mvn.nativeSrcJNI" value="${nativeSrcJNI}" />
								<property name="mvn.nativeSrcUDT" value="${nativeSrcUDT}" />
								<property name="mvn.nativeInclude" value="${nativeInclude}" />
								<property name="mvn.basedir" value="${basedir}" />
								<property name="mvn.resources" value="${basedir}/src/main/resources" />
								<property name="mvn.target" value="${project.build.directory}" />
								<ant antfile="${basedir}/build/script/build-maven.ant">
									<target name="target-build" />
								</ant>
							</tasks>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-resources-plugin</artifactId>
				<executions>
					<execution>
						<id>copy-udt-artifact-files</id>
						<phase>compile</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>
							<resources>
								<resource>
									<directory>src/main/resources</directory>
									<filtering>false</filtering>
									<includes>
										<include>**/*.dll</include>
										<include>**/*.so</include>
										<include>**/*.jnilib</include>
										<include>**/*.map</include>
										<include>**/*.sym</include>
									</includes>
								</resource>
							</resources>
							<outputDirectory>${basedir}/target/classes</outputDirectory>
						</configuration>
					</execution>
				</executions>
			</plugin>

		</plugins>
	</build>

	<dependencies>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
			<version>1.6.1</version>
			<type>jar</type>
			<scope>compile</scope>
			<optional>false</optional>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-log4j12</artifactId>
			<version>1.6.1</version>
			<type>jar</type>
			<scope>runtime</scope>
			<optional>true</optional>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.8.2</version>
			<type>jar</type>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<distributionManagement>
		<!-- <repository> -->
		<!-- <id>barchart-nexus-server</id> -->
		<!-- <url>https://moe.barchart.com/nexus/content/repositories/releases/</url> -->
		<!-- </repository> -->
		<!-- <snapshotRepository> -->
		<!-- <id>barchart-nexus-server</id> -->
		<!-- <url>https://moe.barchart.com/nexus/content/repositories/snapshots/</url> -->
		<!-- </snapshotRepository> -->
	</distributionManagement>

	<!-- <repositories> -->
	
	<!-- <repository> -->
	<!-- <id>barchart-nexus-server</id> -->
	<!-- <url>https://moe.barchart.com/nexus/content/groups/all</url> -->
	<!-- </repository> -->
	
	<!-- </repositories> -->

	<!-- <pluginRepositories> -->
	
	<!-- <pluginRepository> -->
	<!-- licence formatter: maven-license-plugin -->
	<!-- <id>mc-release</id> -->
	<!-- <name>Local Maven repository of releases</name> -->
	<!-- <url>http://mc-repo.googlecode.com/svn/maven2/releases</url> -->
	<!-- <snapshots> -->
	<!-- <enabled>false</enabled> -->
	<!-- </snapshots> -->
	<!-- <releases> -->
	<!-- <enabled>true</enabled> -->
	<!-- </releases> -->
	<!-- </pluginRepository> -->
	
	<!-- <pluginRepository> -->
	<!-- javadoc formatter: javolution-colapi -->
	<!-- <id>maven2-repository.dev.java.net</id> -->
	<!-- <name>Java.net Repository for Maven</name> -->
	<!-- <url>http://download.java.net/maven/2/</url> -->
	<!-- <layout>default</layout> -->
	<!-- </pluginRepository> -->
	
	<!-- </pluginRepositories> -->

	<profiles>

		<profile>
			<!-- update documents -->
			<id>documents</id>
			<build>
				<plugins>

					<plugin>
						<groupId>javolution</groupId>
						<artifactId>colapi</artifactId>
						<configuration>
							<directory>apidocs</directory>
						</configuration>
						<executions>
							<execution>
								<phase>package</phase>
								<goals>
									<goal>colorize</goal>
								</goals>
							</execution>
						</executions>
					</plugin>

					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-javadoc-plugin</artifactId>
						<configuration>
							<encoding>UTF-8</encoding>
							<stylesheetfile>${basedir}/src/main/javadoc/stylesheet.css</stylesheetfile>
							<docfilessubdirs>true</docfilessubdirs>
							<links>
								<link>http://java.sun.com/javase/6/docs/api/</link>
							</links>
						</configuration>
						<executions>
							<execution>
								<id>attach-javadocs</id>
								<phase>package</phase>
								<goals>
									<goal>jar</goal>
								</goals>
							</execution>
						</executions>
					</plugin>

					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-source-plugin</artifactId>
						<executions>
							<execution>
								<id>attach-sources</id>
								<phase>package</phase>
								<goals>
									<goal>jar</goal>
								</goals>
							</execution>
						</executions>
					</plugin>

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

		<profile>
			<!-- update license -->
			<id>license</id>
			<build>
				<plugins>

					<plugin>
						<groupId>com.google.code.maven-license-plugin</groupId>
						<artifactId>maven-license-plugin</artifactId>
						<configuration>
							<encoding>UTF-8</encoding>
							<quiet>false</quiet>
							<failIfMissing>true</failIfMissing>
							<header>${basedir}/build/licence/licence-bsd.template</header>
							<properties>
								<STAMP>${mavenStamp}</STAMP>
								<YEAR>${licenceYear}</YEAR>
								<ORGANIZATION>${licenceOrganization}</ORGANIZATION>
								<WEBSITE>${licenceWebsite}</WEBSITE>
								<DEVELOPERS>${licenceDevelopers}</DEVELOPERS>
							</properties>
							<includes>
								<include>src/main/**</include>
								<include>src/rest/**</include>
								<include>${nativeSrcJNI}/**</include>
							</includes>
							<excludes>
								<exclude>${nativeSrcUDT}/**</exclude>
								<exclude>**/*.dll</exclude>
								<exclude>**/*.jnilib</exclude>
								<exclude>**/*.so</exclude>
								<exclude>**/*.map</exclude>
								<exclude>**/*.properties</exclude>
							</excludes>
							<mapping>
								<properties>SCRIPT_STYLE</properties>
							</mapping>
						</configuration>
						<executions>
							<execution>
								<id>format-license-headers</id>
								<phase>generate-sources</phase>
								<goals>
									<goal>format</goal>
								</goals>
							</execution>
						</executions>
					</plugin>

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

		<profile>
			<!-- get updated UDT sources form CVS -->
			<id>checkout</id>
			<build>
				<plugins>

					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-scm-plugin</artifactId>
						<configuration>
							<connectionType>connection</connectionType>
							<connectionUrl>${connectionUDT}</connectionUrl>
							<checkoutDirectory>${checkoutUDT}</checkoutDirectory>
							<useExport>true</useExport>
							<cvs-settings>
								<traceCvsCommand>true</traceCvsCommand>
								<compressionLevel>5</compressionLevel>
							</cvs-settings>
						</configuration>
						<executions>
							<execution>
								<id>checkout-udt-sources-from-csv</id>
								<phase>generate-sources</phase>
								<goals>
									<goal>checkout</goal>
								</goals>
							</execution>
						</executions>
					</plugin>

					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-resources-plugin</artifactId>
						<executions>
							<execution>
								<id>copy-udt-sources-after-checkout</id>
								<phase>process-sources</phase>
								<goals>
									<goal>copy-resources</goal>
								</goals>
								<configuration>
									<overwrite>true</overwrite>
									<resources>
										<resource>
											<directory> ${checkoutUDT}/${moduleUDT}</directory>
											<filtering>false</filtering>
										</resource>
									</resources>
									<outputDirectory>${nativeSrcUDT}</outputDirectory>
								</configuration>
							</execution>
						</executions>
					</plugin>

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

		<profile>
			<!-- "think different": macosx provides tools.jar classes already in classes.jar
				and does not provide tools.jar -->
			<!-- vendor @ macosx: java.vendor=Apple, Inc. -->
			<!-- vendor @ windows: java.vendor=Sun Microsystems Inc. -->
			<!-- vendor @ linux: java.vendor=Sun Microsystems Inc. -->
			<id>tools.jar</id>
			<activation>
				<property>
					<name>java.vendor</name>
					<value>Sun Microsystems Inc.</value>
				</property>
			</activation>
			<build>
				<pluginManagement>
					<plugins>
						<plugin>
							<groupId>org.apache.maven.plugins</groupId>
							<artifactId>maven-antrun-plugin</artifactId>
							<dependencies>
								<dependency>
									<groupId>com.sun.jdk</groupId>
									<artifactId>jdk-tools</artifactId>
									<version>1.6.0</version>
									<scope>system</scope>
									<systemPath>${java.home}/../lib/tools.jar</systemPath>
								</dependency>
							</dependencies>
						</plugin>
					</plugins>
				</pluginManagement>
			</build>
		</profile>

	</profiles>

</project>
