<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">
	<parent>
		<groupId>com.atlassian.jira.tests</groupId>
		<artifactId>jira-testkit-plugin-parent</artifactId>
		<version>9.0.0-5a6e2a6f</version>
	</parent>
	<modelVersion>4.0.0</modelVersion>
	<artifactId>jira-testkit-client</artifactId>
	<name>Jira TestKit - Client</name>
	<packaging>jar</packaging>

	<build>
		<plugins>
			<plugin>
				<artifactId>maven-surefire-plugin</artifactId>
			</plugin>

			<!-- For some reason jira-maven-plugin can take it only from test-classes/it, which is odd
			 because it looks as if classes were in it.com.atlassian... package, some Italian company,
			 I guess :)

			 Before it will be fixed, we are going to compile src/it/(java|resources) into test-classes/it,
			 three following plugins do the job -->
			<plugin>
				<artifactId>maven-failsafe-plugin</artifactId>
				<configuration>
					<testClassesDirectory>${project.build.testOutputDirectory}/it</testClassesDirectory>
				</configuration>
			</plugin>

			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<executions>
					<execution>
						<id>compile-its</id>
						<goals>
							<goal>testCompile</goal>
						</goals>
						<configuration>
							<compileSourceRoots>
								<compileSourceRoot>${project.basedir}/src/it/java</compileSourceRoot>
							</compileSourceRoots>
							<outputDirectory>${project.build.testOutputDirectory}/it</outputDirectory>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<artifactId>maven-resources-plugin</artifactId>
				<executions>
					<execution>
						<id>copy-resources</id>
						<phase>test-compile</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>
							<outputDirectory>${project.build.testOutputDirectory}/it</outputDirectory>
							<resources>
								<resource>
									<directory>${project.basedir}/src/it/resources</directory>
								</resource>
							</resources>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>com.atlassian.maven.plugins</groupId>
				<artifactId>maven-clover2-plugin</artifactId>
				<version>${clover.version}</version>
				<configuration>
					<excludes>
						<exclude>**/**</exclude>
					</excludes>
				</configuration>
			</plugin>
		</plugins>
	</build>
	<profiles>
		<profile>
			<id>jar-with-dependencies</id>
			<build>
				<plugins>
					<plugin>
						<artifactId>maven-assembly-plugin</artifactId>
						<version>2.2</version>
						<configuration>
							<descriptorRefs>
								<descriptorRef>jar-with-dependencies</descriptorRef>
							</descriptorRefs>
						</configuration>
						<executions>
							<execution>
								<id>build-jar-with-dependencies</id>
								<phase>package</phase>
								<goals>
									<goal>single</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>

		<profile>
			<id>run-integration-tests</id>
			<activation>
				<property>
					<name>integrationTests</name>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>com.atlassian.maven.plugins</groupId>
						<artifactId>jira-maven-plugin</artifactId>
						<version>8.13.1</version>
						<executions>
							<execution>
								<id>default-integration-test</id>
								<goals>
									<goal>integration-test</goal>
								</goals>
								<phase>integration-test</phase>
							</execution>
						</executions>
						<configuration>
							<functionalTestPattern>**/*.*</functionalTestPattern>
							<processI18nUsage>false</processI18nUsage>
							<skipITs>${skipITs}</skipITs>
							<systemPropertyVariables>
								<atlassian.dev.mode>false</atlassian.dev.mode>
								<atlassian.webresource.disable.minification>false</atlassian.webresource.disable.minification>
								<plugin.webresource.batching.off>false</plugin.webresource.batching.off>
								<atlassian.mail.senddisabled>true</atlassian.mail.senddisabled>
								<atlassian.mail.fetchdisabled>true</atlassian.mail.fetchdisabled>

								<!-- we run on XVFB, since that's the way the build engineers would
                                    like to go, as opposed to VNC server (according to Min'an) -->
								<xvfb.enable>true</xvfb.enable>
								<xvfb.options>-once</xvfb.options>

								<!-- By default, we don't like to deal with websudo, it's just an annoyance -->
								<jira.websudo.is.disabled>true</jira.websudo.is.disabled>

								<webdriver.browser>firefox</webdriver.browser>
								<atlassian.plugins.enable.wait>90</atlassian.plugins.enable.wait>
							</systemPropertyVariables>
							<jvmArgs>-Xmx1536m -Dcom.atlassian.jira.startup.LauncherContextListener.SYNCHRONOUS=true</jvmArgs>
							<skipManifestValidation>true</skipManifestValidation>
							<productVersion>${jira.version}</productVersion>
							<productDataVersion>${jira.version}</productDataVersion>

							<pluginArtifacts>
								<pluginArtifact>
									<groupId>com.atlassian.jira.tests</groupId>
									<artifactId>jira-testkit-plugin</artifactId>
									<version>${project.version}</version>
								</pluginArtifact>
							</pluginArtifacts>

							<products>
								<product>
									<id>jira</id>
									<!-- Defining the product version and data version. These configurations control
                                        the version which the integration tests run against. These do NOT control the
                                        version used when you run jira:run -->
									<version>${jira.version}</version>
									<dataVersion>${jira.version}</dataVersion>
								</product>
							</products>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

	<dependencies>
		<dependency>
			<groupId>com.atlassian.jira.tests</groupId>
			<artifactId>jira-testkit-common</artifactId>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<groupId>com.atlassian.jira.tests</groupId>
			<artifactId>jira-testkit-testresources</artifactId>
			<version>${project.version}</version>
			<scope>test</scope>
			<type>test-jar</type>
		</dependency>

		<!-- jira api -->

		<dependency>
			<groupId>com.atlassian.jira</groupId>
			<artifactId>jira-api</artifactId>
			<exclusions>
				<exclusion>
					<groupId>*</groupId>
					<artifactId>*</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>com.atlassian.jira</groupId>
			<artifactId>jira-rest-api</artifactId>
		</dependency>
		<dependency>
			<groupId>io.atlassian.fugue</groupId>
			<artifactId>fugue</artifactId>
		</dependency>
		<dependency>
			<groupId>com.atlassian.gadgets</groupId>
			<artifactId>atlassian-gadgets-api</artifactId>
		</dependency>
		<dependency>
			<groupId>com.atlassian.applinks</groupId>
			<artifactId>applinks-api</artifactId>
		</dependency>
		<dependency>
			<groupId>com.atlassian.core</groupId>
			<artifactId>atlassian-core</artifactId>
		</dependency>
		<dependency>
			<artifactId>embedded-crowd-api</artifactId>
			<groupId>com.atlassian.crowd</groupId>
		</dependency>

		<!-- 3rd party -->
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
		</dependency>
		<dependency>
			<groupId>org.hamcrest</groupId>
			<artifactId>hamcrest-core</artifactId>
		</dependency>
		<dependency>
			<groupId>org.hamcrest</groupId>
			<artifactId>hamcrest-library</artifactId>
		</dependency>

		<dependency>
			<groupId>org.glassfish.jersey.core</groupId>
			<artifactId>jersey-common</artifactId>
		</dependency>
		<dependency>
			<groupId>org.glassfish.jersey.core</groupId>
			<artifactId>jersey-client</artifactId>
		</dependency>
		<dependency>
			<groupId>org.glassfish.jersey.media</groupId>
			<artifactId>jersey-media-multipart</artifactId>
		</dependency>
		<dependency>
			<groupId>org.glassfish.jersey.connectors</groupId>
			<artifactId>jersey-apache-connector</artifactId>
		</dependency>
		<dependency>
			<groupId>commons-httpclient</groupId>
			<artifactId>commons-httpclient</artifactId>
		</dependency>
		<dependency>
			<groupId>commons-lang</groupId>
			<artifactId>commons-lang</artifactId>
		</dependency>
		<dependency>
			<groupId>joda-time</groupId>
			<artifactId>joda-time</artifactId>
		</dependency>
		<dependency>
			<groupId>com.fasterxml.jackson.jaxrs</groupId>
			<artifactId>jackson-jaxrs-json-provider</artifactId>
		</dependency>
		<dependency>
			<groupId>com.fasterxml.jackson.core</groupId>
			<artifactId>jackson-databind</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-core</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.logging.log4j</groupId>
			<artifactId>log4j-slf4j-impl</artifactId>
			<version>2.20.0</version>
		</dependency>
		<dependency>
			<groupId>org.json</groupId>
			<artifactId>json</artifactId>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.mockito</groupId>
			<artifactId>mockito-core</artifactId>
		</dependency>
		<dependency>
			<groupId>org.awaitility</groupId>
			<artifactId>awaitility</artifactId>
		</dependency>
		<dependency>
			<groupId>javax.xml.bind</groupId>
			<artifactId>jaxb-api</artifactId>
		</dependency>
		<dependency>
			<groupId>commons-io</groupId>
			<artifactId>commons-io</artifactId>
		</dependency>
	</dependencies>
</project>
