<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.quickfixj</groupId>
		<artifactId>quickfixj-parent</artifactId>
		<version>3.0.0</version>
	</parent>

	<artifactId>quickfixj-base</artifactId>
	<packaging>jar</packaging>

	<name>QuickFIX/J Base</name>
	<description>Base classes for messages and fields</description>
	<url>http://www.quickfixj.org</url>

	<properties>
	</properties>

	<dependencies>
		<dependency>
			<groupId>org.junit.vintage</groupId>
			<artifactId>junit-vintage-engine</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.mockito</groupId>
			<artifactId>mockito-core</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.hamcrest</groupId>
			<artifactId>hamcrest</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
			<version>${slf4j.version}</version>
		</dependency>
	</dependencies>

	<build>
		<resources>
		</resources>

		<testResources>
			<testResource>
				<directory>${project.basedir}/src/test/resources</directory>
			</testResource>
			<testResource>
				<directory>../quickfixj-messages/quickfixj-messages-fixt11/src/main/resources</directory>
			</testResource>
			<testResource>
				<directory>../quickfixj-messages/quickfixj-messages-fix50/src/main/resources</directory>
			</testResource>
			<testResource>
				<directory>../quickfixj-messages/quickfixj-messages-fix44/src/main/resources</directory>
			</testResource>
			<testResource>
				<directory>../quickfixj-messages/quickfixj-messages-fix40/src/main/resources</directory>
			</testResource>
		</testResources>

		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<configuration>
					<excludes>
						<exclude>quickfix/fixlatest/**</exclude>
					</excludes>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>xml-maven-plugin</artifactId>
				<executions>
					<execution>
						<id>extractRequiredFields</id>
						<phase>generate-sources</phase>
						<goals>
							<goal>transform</goal>
						</goals>
						<configuration>
						<transformationSets>
							<transformationSet>
								<dir>${project.basedir}/../quickfixj-orchestration/target/generated-resources</dir>
								<outputDir>${project.build.directory}/generated-resources/extracted</outputDir>
								<includes>
									<include>${orchestra.file}</include>
								</includes>
								<stylesheet>${project.basedir}/src/main/xsl/extractRequiredFields.xsl</stylesheet>
								</transformationSet>
							</transformationSets>
						</configuration>
					</execution>
					<execution>
						<id>addRequiredFields</id>
						<phase>generate-sources</phase>
						<goals>
							<goal>transform</goal>
						</goals>
						<configuration>
							<transformationSets>
								<transformationSet>
									<dir>${project.build.directory}/generated-resources/extracted</dir>
									<outputDir>${project.build.directory}/generated-resources</outputDir>
									<includes>
										<include>${orchestra.file}</include>
									</includes>
									<stylesheet>${project.basedir}/src/main/xsl/addRequiredFields.xsl</stylesheet>
								</transformationSet>
							</transformationSets>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<!-- Generate FIX Latest -->
				<groupId>org.quickfixj.orchestra</groupId>
				<artifactId>quickfixj-from-fix-orchestra-code-generator-maven-plugin</artifactId>
				<executions>
					<execution>
						<phase>generate-sources</phase>
						<goals>
							<goal>codeGeneration</goal>
						</goals>
						<id>fixLatest</id>
					</execution>
				</executions>
				<configuration>
					<orchestration>${project.build.directory}/generated-resources/${orchestra.file}</orchestration>
					<outputDirectory>${project.build.directory}/generated-sources</outputDirectory>
				</configuration>
			</plugin>			
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<executions>
					<execution>
						<phase>generate-sources</phase>
						<goals>
							<goal>add-source</goal>
						</goals>
						<configuration>
							<sources>
								<source>${project.build.directory}/generated-sources</source>
							</sources>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<configuration>
					<includes>
						<include>quickfix/*</include>
						<include>org/**</include>
						<include>quickfix/field/*</include>
						<include>quickfix/field/converter/*</include>
					</includes>
					<excludes>
						<exclude>quickfix/fixt11</exclude>
						<exclude>quickfix/fixlatest</exclude>
					</excludes>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
				<configuration>
					<includes>
						<include>quickfix/*</include>
						<include>quickfix/mina/*</include>
						<include>org/**</include>
						<include>quickfix/field/*</include>
						<include>quickfix/field/converter/*</include>
					</includes>
					<excludes>
						<exclude>quickfix/fixt11</exclude>
						<exclude>quickfix/fixlatest</exclude>
					</excludes>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<executions>
					<execution>
						<id>attach-javadocs</id>
						<goals>
							<goal>jar</goal>
						</goals>
						<configuration>
							<!-- Uncomment this to skip execution as this module requires more than 9gb memory -->
							<!--  skip>true</skip -->
							<quiet>true</quiet>
							<source>8</source>
							<sourcepath>src/main/java:${project.build.directory}/generated-sources</sourcepath>
							<excludePackageNames>quickfix.fixt11:quickfix.fixlatest</excludePackageNames>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.felix</groupId>
				<artifactId>maven-bundle-plugin</artifactId>
				<configuration>
					<instructions>
						<Export-Package>quickfix,quickfix.*,org.quickfixj,org.quickfixj.*</Export-Package>
						<Private-Package />
					</instructions>
				</configuration>
			</plugin>
		</plugins>
	</build>

	<reporting>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-report-plugin</artifactId>
				<version>${maven-surefire-plugin-version}</version>
				<reportSets />
				<configuration>
					<showSuccess>true</showSuccess>
				</configuration>
			</plugin>
			<plugin>
				<artifactId>maven-jxr-plugin</artifactId>
				<version>3.6.0</version>
			</plugin>
		</plugins>
	</reporting>

	<profiles>
		<!-- select different java options on JDK8 for surefire since otherwise the build will fail -->
		<profile>
			<id>surefire-java8</id>
			<activation>
				<jdk>1.8</jdk>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-surefire-plugin</artifactId>
						<configuration>
							<argLine>
							</argLine>
							<trimStackTrace>false</trimStackTrace>
							<includes>
							</includes>
							<excludes>
							</excludes>
							<systemPropertyVariables>
							</systemPropertyVariables>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
		<!-- surefire for JDK9 and upwards -->
		<profile>
			<id>surefire</id>
			<activation>
				<jdk>[1.9,)</jdk>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-surefire-plugin</artifactId>
						<configuration>
							<argLine>
							</argLine>
							<trimStackTrace>false</trimStackTrace>
							<includes>
							</includes>
							<excludes>
							</excludes>
							<systemPropertyVariables>
							</systemPropertyVariables>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>
