<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.googlecode</groupId>
	<artifactId>jyield</artifactId>
	<packaging>jar</packaging>
	<version>0.0.6</version>
	<name>jyield</name>
	<properties>
		<maven.build.timestamp.format>yyyyMMdd-HHmm</maven.build.timestamp.format>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
	</properties>
	<scm>
		<connection>scm:svn:http://jyield.googlecode.com/svn/trunk/jyield</connection>
		<developerConnection>scm:svn:https://jyield.googlecode.com/svn/trunk/jyield</developerConnection>
	</scm>
	<url>http://jyield.googlecode.com</url>
	<!-- <pluginRepositories> -->
	<!-- <pluginRepository> -->
	<!-- <id>repository.riedelcastro.org</id> -->
	<!-- <url>http://repository.riedelcastro.org</url> -->
	<!-- </pluginRepository> -->
	<!-- </pluginRepositories> -->

	<repositories>
		<repository>
			<id>maven2-repository.dev.java.net</id>
			<name>Java.net Repository for Maven</name>
			<url>http://download.java.net/maven/2</url>
		</repository>
	</repositories>

	<distributionManagement>
<!--		<repository>-->
<!--			<uniqueVersion>false</uniqueVersion>-->
<!--			<id>googlecode</id>-->
<!--			<url>svn:https://jyield.googlecode.com/svn/repository</url>-->
<!--		</repository>-->
		<repository>
			<id>java.net-m2-repository</id>
			<url>java-net:/maven2-repository/trunk/repository/</url>
		</repository>
	</distributionManagement>
	<build>
		<!-- <finalName>${project.artifactId}-${project.version}-r${buildNumber}</finalName> -->
		<extensions>
			<extension>
				<groupId>org.jvnet.wagon-svn</groupId>
				<artifactId>wagon-svn</artifactId>
				<version>1.9</version>
			</extension>
		</extensions>
		<plugins>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>buildnumber-maven-plugin</artifactId>
				<version>1.0-beta-4</version>
				<executions>
					<execution>
						<id>generating-build-number</id>
						<phase>validate</phase>
						<goals>
							<goal>create</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<!--<doCheck>true</doCheck> <doUpdate>true</doUpdate> -->
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>2.1</version>
				<configuration>
					<source>1.6</source>
					<target>1.6</target>
					<encoding>${project.build.sourceEncoding}
					</encoding>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>2.5</version>
				<configuration>
					<forkMode>once</forkMode>
					<argLine>-javaagent:util/jyield-test-agent.jar
					</argLine>
					<useSystemClassLoader>true</useSystemClassLoader>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<configuration>
					<archive>
						<manifestEntries>
							<mode>development</mode>
							<url>${pom.url}</url>
						</manifestEntries>
						<manifestFile>src/main/resources/META-INF/MANIFEST.MF
						</manifestFile>
					</archive>
				</configuration>
			</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>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<executions>
					<execution>
						<id>attach-javadocs</id>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<artifactId>maven-assembly-plugin</artifactId>
				<version>2.1</version>
				<configuration>
					<descriptors>
						<descriptor>src/main/assembly/with-deps.xml</descriptor>
						<descriptor>src/main/assembly/runtime.xml
						</descriptor>
						<descriptor>src/main/assembly/dist.xml
						</descriptor>
					</descriptors>
					<archive>
						<manifestFile>src/main/resources/META-INF/MANIFEST.MF
						</manifestFile>
					</archive>
				</configuration>
				<executions>
					<execution>
						<id>assemblies</id>
						<phase>package</phase>
						<goals>
							<goal>single</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-antrun-plugin</artifactId>
				<version>1.3</version>
				<executions>
					<execution>
						<phase>integration-test</phase>
						<configuration>
							<tasks>
								<property name="build.compiler" value="extJavac" />
								<property name="target" value="${project.build.finalName}" />
								<property name="builddir" value="${project.build.directory}" />
								<property name="workdir"
									value="${project.build.directory}/test-dist/${target}" />
								<delete dir="${workdir}" failonerror="false" />

								<unzip src="${builddir}/${target}-dist.zip" dest="${builddir}/test-dist" />
								<javac srcdir="${workdir}/examples/basic" destdir="${workdir}/examples/basic"
									classpath="${workdir}/${target}-jar-with-dependencies.jar"
									debug="on" source="1.6" />
								<java className="Sample" fork="true" dir="${workdir}/examples/basic"
									failonerror="true" outputproperty="sample.output01">
									<jvmarg
										value="-javaagent:${workdir}/${target}-jar-with-dependencies.jar" />
									<classpath>
										<pathelement location="${workdir}/examples/basic" />
									</classpath>
								</java>
								<echo message="${sample.output01}" />
								<fail message="Sample code does not produce the expected result!">
									<condition>
										<not>
											<equals arg1="${sample.output01}"
												arg2="[2] 2 [4] 4 [8] 8 [16] 16 [32] 32 [64] 64 [128] 128 [256] 256 " />
										</not>
									</condition>
								</fail>
								<java jar="${workdir}/${target}-jar-with-dependencies.jar"
									fork="true" dir="${workdir}/examples/basic" failonerror="true">
									<arg value="--overwrite" />
									<arg value="--verbose" />
									<arg value="Sample.class" />
								</java>
								<java className="Sample" fork="true" dir="${workdir}/examples/basic"
									failonerror="true" outputproperty="sample.output02">
									<classpath>
										<pathelement location="${workdir}/${target}-runtime.jar" />
										<pathelement location="${workdir}/examples/basic" />
									</classpath>
								</java>
								<echo message="${sample.output02}" />
								<fail message="Sample code does not produce the expected result!">
									<condition>
										<not>
											<equals arg1="${sample.output02}"
												arg2="[2] 2 [4] 4 [8] 8 [16] 16 [32] 32 [64] 64 [128] 128 [256] 256 " />
										</not>
									</condition>
								</fail>
							</tasks>
						</configuration>
						<goals>
							<goal>run</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<!-- <plugin> -->
			<!-- <groupId>org.riedelcastro</groupId> -->
			<!-- <artifactId>gcupload-maven-plugin</artifactId> -->
			<!-- <version>0.9</version> -->
			<!-- <configuration> -->
			<!-- <projectName>jyield</projectName> -->
			<!-- <allowSnapshots>false</allowSnapshots> -->
			<!-- <uploads> -->
			<!-- <upload> -->
			<!-- <extensions>zip</extensions> -->
			<!-- <labels>Type-Library,Featured</labels> -->
			<!-- <prefix>${project.build.finalName}</prefix> -->
			<!-- <postfix>dist</postfix> -->
			<!-- <summary>jyield distribution with binaries and sources</summary> -->
			<!-- </upload> -->
			<!-- </uploads> -->
			<!-- </configuration> -->
			<!-- </plugin> -->
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<version>1.5</version>
				<executions>
					<execution>
						<id>add-test-source</id>
						<phase>generate-sources</phase>
						<goals>
							<goal>add-test-source</goal>
						</goals>
						<configuration>
							<sources>
								<source>examples/basic</source>
							</sources>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>

	</build>
	<dependencies>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.7</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>asm</groupId>
			<artifactId>asm</artifactId>
			<version>3.2</version>
		</dependency>
		<dependency>
			<groupId>asm</groupId>
			<artifactId>asm-analysis</artifactId>
			<version>3.2</version>
		</dependency>
		<dependency>
			<groupId>asm</groupId>
			<artifactId>asm-commons</artifactId>
			<version>3.2</version>
		</dependency>
		<dependency>
			<groupId>asm</groupId>
			<artifactId>asm-tree</artifactId>
			<version>3.2</version>
		</dependency>
		<dependency>
			<groupId>asm</groupId>
			<artifactId>asm-util</artifactId>
			<version>3.2</version>
		</dependency>
	</dependencies>
</project>
