<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/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<parent>
		<groupId>org.quickfixj</groupId>
		<artifactId>quickfixj-messages</artifactId>
		<version>3.0.2</version>
	</parent>

	<artifactId>quickfixj-messages-fixlatest</artifactId>
	<packaging>jar</packaging>

	<name>QuickFIX/J Message classes for FIX Latest</name>
	<description>QuickFIX/J Message classes for FIX Latest</description>
	<url>http://www.quickfixj.org</url>
	<dependencies>
		<dependency>
			<groupId>org.quickfixj</groupId>
			<artifactId>quickfixj-base</artifactId>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<groupId>org.quickfixj</groupId>
			<artifactId>quickfixj-messages-fixt11</artifactId>
			<scope>runtime</scope>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<groupId>org.junit.vintage</groupId>
			<artifactId>junit-vintage-engine</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.quickfixj.orchestra</groupId>
			<artifactId>quickfixj-from-fix-orchestra-generator</artifactId>
			<version>${org.quickfixj.orchestra.tools.version}</version>
			<scope>test</scope>
		</dependency>
		<!-- The orchestra generator (1.0.3) was compiled against io.fixprotocol.orchestra:repository:1.6.8
		     (Java 8 bytecode). The parent POM manages this artifact at 1.7.3 (Java 11 bytecode), which
		     would break JDK 8 builds. Pin it explicitly here to force the JDK 8 compatible version. -->
		<dependency>
			<groupId>io.fixprotocol.orchestra</groupId>
			<artifactId>repository</artifactId>
			<version>1.6.8</version>
			<scope>test</scope>
		</dependency>
		<!-- The orchestra generator uses javax.xml.bind (JAXB 2.x API), which was removed
		     from the JDK in Java 11. Add the standalone API jar so it is available on JDK 11+. -->
		<dependency>
			<groupId>javax.xml.bind</groupId>
			<artifactId>jaxb-api</artifactId>
			<version>2.3.1</version>
			<scope>test</scope>
		</dependency>
		<!-- The orchestra generator was compiled against javax.xml.bind (JAXB 2.x).
		     The parent POM manages jaxb-impl at 4.x (jakarta.xml.bind namespace), so we
		     pin the 2.3.3 variant here to satisfy the generator's SPI look-up at test time. -->
		<dependency>
			<groupId>com.sun.xml.bind</groupId>
			<artifactId>jaxb-impl</artifactId>
			<version>2.3.3</version>
			<scope>test</scope>
		</dependency>
	</dependencies>
	<profiles>
		<profile>
			<id>full-fix-latest</id>
			<!-- This profile builds the full fix latest specification to testing that a new version of the full specification
					 does not introduce issues in the core QuickFIX/J build -->
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-javadoc-plugin</artifactId>
						<configuration>
							<skip>true</skip>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
	<build>
		<plugins>
			<plugin>
				<artifactId>maven-resources-plugin</artifactId>
				<executions>
					<execution>
						<id>copy-sources</id>
						<phase>generate-sources</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>
							<outputDirectory>${project.build.directory}/generated-sources/quickfix</outputDirectory>
							<resources>
								<resource>
									<directory>${project.basedir}/../quickfixj-messages-all/target/generated-sources/quickfix</directory>
									<includes>
										<include>**/fixlatest/**/*.java</include>
									</includes>
								</resource>
								<resource>
									<directory>${project.basedir}/../quickfixj-messages-all/target/generated-sources/quickfix</directory>
									<includes>
										<include>**/field/*.java</include>
									</includes>
								</resource>
							</resources>
						</configuration>
					</execution>
					<execution>
						<id>copy-classes</id>
						<phase>generate-sources</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>
							<outputDirectory>${project.build.directory}/classes/quickfix</outputDirectory>
							<resources>
								<resource>
									<directory>${project.basedir}/../quickfixj-messages-all/target/classes/quickfix</directory>
									<includes>
										<include>**/fixlatest/**/*.class</include>
									</includes>
								</resource>
								<resource>
									<directory>${project.basedir}/../quickfixj-messages-all/target/classes/quickfix</directory>
									<includes>
										<include>**/field/*.class</include>
									</includes>
								</resource>
							</resources>
						</configuration>
					</execution>
					<execution>
						<id>copy-fixlatest-xml</id>
						<phase>generate-sources</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>
							<outputDirectory>${project.build.directory}/classes</outputDirectory>
							<resources>
								<resource>
									<directory>${project.basedir}/../quickfixj-messages-all/target/classes</directory>
									<includes>
										<include>FIXLatest.xml</include>
									</includes>
								</resource>
							</resources>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<!-- prune classes that are not in the FIX Dictionaries specified below -->
				<groupId>org.quickfixj</groupId>
				<artifactId>quickfixj-class-pruner-maven-plugin</artifactId>
				<executions>
					<execution>
						<id>prune</id>
						<phase>process-classes</phase>
						<goals>
							<goal>prune</goal>
						</goals>
						<configuration>
							<classesDirectory>${project.build.directory}/classes/quickfix/field</classesDirectory>
							<generatedSourcesDirectory>${project.build.directory}/generated-sources/quickfix/field</generatedSourcesDirectory>
							<fileset>
								<directory>${project.basedir}/../quickfixj-messages-all/target/classes/</directory>
								<includes>
									<include>**/*.xml</include>
								</includes>
								<excludes>
									<exclude>FIXT11.xml</exclude>		<!-- Exclude FIXT11 which has been built separately -->
									<exclude>OrchestraFIXLatest.xml</exclude>
									<exclude>FIX50SP2.xml</exclude>	<!-- QFJ code generation uses a modified version of this dictionary, this one is redundant -->
									<exclude>FIX50SP1.xml</exclude>	<!-- QFJ code generation uses a modified version of this dictionary, this one is redundant -->
									<exclude>FIX44.xml</exclude>	<!-- QFJ code generation uses a modified version of this dictionary, this one is redundant -->
								</excludes>
								<followSymlinks>false</followSymlinks>
							</fileset>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<executions>
					<execution>
						<phase>prepare-package</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.felix</groupId>
				<artifactId>maven-bundle-plugin</artifactId>
				<executions>
					<execution>
						<id>bundle-manifest</id>
						<phase>process-classes</phase>
						<goals>
							<goal>manifest</goal>
						</goals>
						<configuration>
							<instructions>
								<Export-Package>quickfix.field;version="${project.version}";uses:=quickfix,quickfix.fixlatest;version="${project.version}";uses:=quickfix,quickfix.field;version="${project.version}"</Export-Package>
								<Import-Package>quickfix,quickfix.field;version="${project.version}"</Import-Package>
								<Require-Capability>osgi.ee;filter:="(&amp;(osgi.ee=JavaSE)(version=${jdkLevel}))"</Require-Capability>
							</instructions>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<configuration>
					<includes>
						<include>FIXLatest.xml</include>
						<include>quickfix/field/*.class</include>
						<include>quickfix/fixlatest/**</include>
					</includes>
					<archive>
						<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
					</archive>
				</configuration>
			</plugin>
			<plugin>
				<artifactId>maven-source-plugin</artifactId>
				<groupId>org.apache.maven.plugins</groupId>
				<configuration>
					<includes>
						<include>FIXLatest.xml</include>
						<include>quickfix/fixlatest/**</include>
						<include>quickfix/field/**</include>
					</includes>
					<archive>
						<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
					</archive>
				</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>
							<quiet>true</quiet>
							<doclint>none</doclint>
							<maxmemory>6g</maxmemory>
							<detectOfflineLinks>false</detectOfflineLinks>
							<includeDependencySources>false</includeDependencySources>
							<sourcepath>${project.build.directory}/generated-sources/quickfix/fixlatest;${project.build.directory}/generated-sources/quickfix/field</sourcepath>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</project>
