<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<modelVersion>4.0.0</modelVersion>
	<groupId>org.cloudfoundry</groupId>
	<artifactId>cloudfoundry-client-lib</artifactId>
	<version>1.1.1</version>
	<packaging>jar</packaging>
	<name>Cloud Foundry Java Client Library</name>
	<description>A Cloud Foundry client library for Java</description>
	<url>http://github.com/cloudfoundry/cf-java-client</url>

	<licenses>
		<license>
			<name>Apache 2.0 License</name>
			<url>http://www.apache.org/licenses/LICENSE-2.0</url>
			<distribution>repo</distribution>
		</license>
	</licenses>

	<scm>
		<url>http://github.com/cloudfoundry/cf-java-client</url>
		<connection>scm:git:git@github.com/cloudfoundry/cf-java-client</connection>
		<developerConnection>scm:git:git@github.com/cloudfoundry/cf-java-client</developerConnection>
	</scm>

	<properties>
		<java.version>1.7</java.version>
		<spring.framework.version>4.0.5.RELEASE</spring.framework.version>
		<spring.security.oauth.version>2.0.4.RELEASE</spring.security.oauth.version>
		<jackson.version>2.3.3</jackson.version>
		<tomcat.version>8.0.15</tomcat.version>
		<jetty.version>8.1.12.v20130726</jetty.version>
		<byteman.version>2.1.3</byteman.version>
	</properties>

	<profiles>
		<profile>
			<id>fast</id>
			<properties>
				<maven.test.skip>true</maven.test.skip>
			</properties>
		</profile>

		<profile>
			<id>integration-test</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-surefire-plugin</artifactId>
						<configuration>
							<includes>
								<include>**/CloudFoundryClientTest.java</include>
							</includes>
							<excludes>
								<exclude>NONE</exclude>
							</excludes>
						</configuration>
					</plugin>

					<!-- Used to syntactically verify our byteman rules that detect unexpected direct sockets not going through proxy -->
					<plugin>
						<groupId>org.jboss.byteman</groupId>
						<artifactId>byteman-rulecheck-maven-plugin</artifactId>
						<version>2.1.3</version>
						<executions>
							<execution>
								<id>rulecheck-test</id>
								<goals>
									<goal>rulecheck</goal>
								</goals>
								<configuration>
									<packages>
										<package>org.cloudfoundry</package>
									</packages>
									<includes>
										<include>**/*.btm</include>
									</includes>
									<verbose>true</verbose>
								</configuration>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-dependency-plugin</artifactId>
						<executions>
							<execution>
								<id>copy-test-app</id>
								<goals>
									<goal>copy</goal>
								</goals>
								<phase>generate-test-resources</phase>
								<configuration>
									<artifactItems>
										<artifactItem>
											<groupId>org.cloudfoundry.test</groupId>
											<artifactId>non-ascii-file-name</artifactId>
											<version>0.1.0.BUILD-SNAPSHOT</version>
											<type>war</type>
											<outputDirectory>${project.build.directory}/generated-test-resources</outputDirectory>
										</artifactItem>
										<artifactItem>
											<groupId>org.cloudfoundry.test</groupId>
											<artifactId>simple-spring-app</artifactId>
											<version>0.1.0.BUILD-SNAPSHOT</version>
											<type>war</type>
											<outputDirectory>${project.build.directory}/generated-test-resources</outputDirectory>
										</artifactItem>
                                        <artifactItem>
                                            <groupId>org.cloudfoundry.test</groupId>
                                            <artifactId>haash-broker</artifactId>
                                            <version>0.1.0.BUILD-SNAPSHOT</version>
                                            <type>jar</type>
                                            <outputDirectory>${project.build.directory}/generated-test-resources</outputDirectory>
                                        </artifactItem>
									</artifactItems>
									<stripVersion>true</stripVersion>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>

			<dependencies>
				<dependency>
					<groupId>com.sun</groupId>
					<artifactId>tools</artifactId>
					<version>${java.version}</version>
					<scope>system</scope>
					<systemPath>${tools.jar}</systemPath>
				</dependency>
				<dependency>
					<groupId>org.cloudfoundry.test</groupId>
					<artifactId>non-ascii-file-name</artifactId>
					<version>0.1.0.BUILD-SNAPSHOT</version>
					<type>war</type>
					<scope>provided</scope>
				</dependency>
				<dependency>
					<groupId>org.cloudfoundry.test</groupId>
					<artifactId>simple-spring-app</artifactId>
					<version>0.1.0.BUILD-SNAPSHOT</version>
					<type>war</type>
					<scope>provided</scope>
				</dependency>
			</dependencies>
		</profile>

		<!-- tools classes are needed by byteman, and their path is system-dependent,
		one of those profiles will be active, in addition to profile controlling which tests are executed -->
		<profile>
			<!-- normally tools jar is in ../lib/tools.jar -->
			<id>default-toolsjar-profile</id>
			<activation>
				<file>
					<exists>${java.home}/../lib/tools.jar</exists>
				</file>
			</activation>
			<properties>
				<tools.jar>${java.home}/../lib/tools.jar</tools.jar>
			</properties>
		</profile>
		<profile>
			<!-- on pre-jdk7 mac releases tools jar is in ../Classes/classes.jar -->
			<id>mac-toolsjar-profile</id>
			<activation>
				<file>
					<exists>${java.home}/../Classes/classes.jar</exists>
				</file>
			</activation>
			<properties>
				<tools.jar>${java.home}/../Classes/classes.jar</tools.jar>
			</properties>
		</profile>      <!-- We override the tools.jar property on mac osx -->

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

	<dependencies>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-webmvc</artifactId>
			<version>${spring.framework.version}</version>
		</dependency>

		<dependency>
			<groupId>org.springframework.security.oauth</groupId>
			<artifactId>spring-security-oauth2</artifactId>
			<version>${spring.security.oauth.version}</version>
			<exclusions>
				<exclusion>
					<groupId>org.springframework</groupId>
					<artifactId>spring-jdbc</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

		<dependency>
			<groupId>org.apache.httpcomponents</groupId>
			<artifactId>httpclient</artifactId>
			<version>4.3.6</version>
		</dependency>
		<dependency>
			<groupId>commons-io</groupId>
			<artifactId>commons-io</artifactId>
			<version>2.1</version>
		</dependency>

		<dependency>
			<groupId>com.esotericsoftware.yamlbeans</groupId>
			<artifactId>yamlbeans</artifactId>
			<version>1.06</version>
		</dependency>

		<dependency>
			<groupId>com.fasterxml.jackson.core</groupId>
			<artifactId>jackson-core</artifactId>
			<version>${jackson.version}</version>
		</dependency>
		<dependency>
			<groupId>com.fasterxml.jackson.core</groupId>
			<artifactId>jackson-databind</artifactId>
			<version>${jackson.version}</version>
		</dependency>

		<dependency>
			<groupId>org.apache.tomcat.embed</groupId>
			<artifactId>tomcat-embed-websocket</artifactId>
			<version>${tomcat.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.tomcat</groupId>
			<artifactId>tomcat-juli</artifactId>
			<version>${tomcat.version}</version>
		</dependency>
		<dependency>
			<groupId>com.google.protobuf</groupId>
			<artifactId>protobuf-java</artifactId>
			<version>2.6.1</version>
		</dependency>

		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.10</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.hamcrest</groupId>
			<artifactId>hamcrest-all</artifactId>
			<version>1.1</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.mockito</groupId>
			<artifactId>mockito-core</artifactId>
			<version>1.9.5</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-test</artifactId>
			<version>${spring.framework.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.eclipse.jetty</groupId>
			<artifactId>jetty-server</artifactId>
			<version>${jetty.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.eclipse.jetty</groupId>
			<artifactId>jetty-servlet</artifactId>
			<version>${jetty.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.eclipse.jetty</groupId>
			<artifactId>jetty-servlets</artifactId>
			<version>${jetty.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>log4j</groupId>
			<artifactId>log4j</artifactId>
			<version>1.2.14</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.jboss.byteman</groupId>
			<artifactId>byteman-bmunit</artifactId>
			<version>${byteman.version}</version>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<build>
		<extensions>
			<extension>
				<groupId>org.springframework.build</groupId>
				<artifactId>aws-maven</artifactId>
				<version>4.4.0.RELEASE</version>
			</extension>
		</extensions>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<configuration>
					<source>${java.version}</source>
					<target>${java.version}</target>
				</configuration>
			</plugin>
			<plugin>
				<groupId>com.github.igor-petruk.protobuf</groupId>
				<artifactId>protobuf-maven-plugin</artifactId>
				<version>0.6.3</version>
				<executions>
					<execution>
						<goals>
							<goal>run</goal>
						</goals>
					</execution>
				</executions>
			</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-surefire-plugin</artifactId>
				<version>2.8</version>
				<configuration>
					<!--forkMode>pertest</forkMode-->
					<includes>
						<include>**/*Test.java</include>
					</includes>
					<excludes>
						<exclude>**/CloudFoundryClientTest.java</exclude>
						<exclude>**/Abstract*.java</exclude>
					</excludes>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-shade-plugin</artifactId>
				<version>2.1</version>
				<executions>
					<execution>
						<phase>package</phase>
						<goals>
							<goal>shade</goal>
						</goals>
						<configuration>
							<artifactSet>
								<includes>
									<include>org.codehaus.jackson:*</include>
								</includes>
							</artifactSet>
							<relocations>
								<relocation>
									<pattern>org.codehaus.jackson</pattern>
									<shadedPattern>org.cloudfoundry.client.lib.org.codehaus.jackson</shadedPattern>
								</relocation>
							</relocations>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
		<testResources>
			<testResource>
				<directory>src/test/resources</directory>
			</testResource>
			<testResource>
				<directory>${project.build.directory}/generated-test-resources</directory>
			</testResource>
		</testResources>
	</build>

	<distributionManagement>
		<repository>
			<id>sonatype-ossrh-staging</id>
			<name>Sonatype OSSRH</name>
			<url>http://oss.sonatype.org/service/local/staging/deploy/maven2</url>
		</repository>
		<snapshotRepository>
			<id>spring-snapshot</id>
			<name>Spring Snapshot Repository</name>
			<url>s3://maven.springframework.org/snapshot</url>
		</snapshotRepository>
	</distributionManagement>

	<developers>
		<developer>
			<id>rladdad</id>
			<name>Ramnivas Laddad</name>
			<email>rladdad at gopivotal.com</email>
		</developer>
		<developer>
			<id>sfrederick</id>
			<name>Scott Frederick</name>
			<email>sfrederick at gopivotal.com</email>
		</developer>
	</developers>

</project>
