<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.eclipse.ee4j.cdi</groupId>
		<artifactId>cdi-parent</artifactId>
		<version>2.0.2-SNAPSHOT</version>
	</parent>

	<artifactId>jakarta.enterprise.cdi-spec-doc</artifactId>
	<packaging>pom</packaging>


	<description>CDI Specification documentation</description>

	<properties>
		<asciidoctor-maven.version>1.5.6</asciidoctor-maven.version>
		<asciidoctorj-pdf.version>1.5.0-alpha.14</asciidoctorj-pdf.version>
		<!-- asl2 for non-final releases, or final for EFSL -->
		<license-file>final</license-file>
		<maven.build.timestamp.format>MMMM dd, yyyy</maven.build.timestamp.format>
		<revisiondate>${maven.build.timestamp}</revisiondate>
	</properties>

	<profiles>
		<profile>
			<id>jboss-public-repository</id>
			<activation>
				<property>
					<name>jboss-public-repository</name>
					<value>!false</value>
				</property>
			</activation>
			<repositories>
				<repository>
					<id>jboss-public-repository-group</id>
					<name>JBoss Public Maven Repository Group</name>
					<url>https://repository.jboss.org/nexus/content/groups/public</url>
					<releases>
						<enabled>true</enabled>
						<updatePolicy>never</updatePolicy>
					</releases>
					<snapshots>
						<enabled>false</enabled>
						<updatePolicy>never</updatePolicy>
					</snapshots>
				</repository>
			</repositories>
			<pluginRepositories>
				<pluginRepository>
					<id>jboss-public-repository-group</id>
					<name>JBoss Public Maven Repository Group</name>
					<url>https://repository.jboss.org/nexus/content/groups/public</url>
					<releases>
						<enabled>true</enabled>
						<updatePolicy>never</updatePolicy>
					</releases>
					<snapshots>
						<enabled>false</enabled>
						<updatePolicy>never</updatePolicy>
					</snapshots>
				</pluginRepository>
			</pluginRepositories>
		</profile>

		<profile>
			<id>tck</id>
			<properties>
				<path.to.cdi.spec>${project.build.directory}/generated-docs/cdi-spec.html</path.to.cdi.spec>
				<tck.version>2.0.3.Final</tck.version>
				<tck.audit.url>https://repo1.maven.org/maven2/org/jboss/cdi/tck/cdi-tck-impl/${tck.version}/cdi-tck-impl-${tck.version}-audit-cdi.xml</tck.audit.url>
				<tck.coverage.url>https://repo1.maven.org/maven2/org/jboss/cdi/tck/cdi-tck-impl/${tck.version}/cdi-tck-impl-${tck.version}-coverage-cdi.html
				</tck.coverage.url>
			</properties>
			<dependencies>
				<dependency>
					<groupId>org.jboss</groupId>
					<artifactId>tck-spec-mapper</artifactId>
					<version>1.0.0.Alpha2</version>
					<type>jar</type>
				</dependency>
			</dependencies>
			<build>
				<plugins>
					<plugin>
						<artifactId>maven-resources-plugin</artifactId>
						<version>2.7</version>
						<executions>
							<execution>
								<id>copy-resources</id>
								<phase>package</phase>
								<goals>
									<goal>copy-resources</goal>
								</goals>
								<configuration>
									<outputDirectory>target/generated-docs/images</outputDirectory>
									<resources>
										<resource>
											<directory>src/main/resources/images/</directory>
										</resource>
									</resources>
								</configuration>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>exec-maven-plugin</artifactId>
						<version>1.3.2</version>
						<executions>
							<execution>
								<phase>package</phase>
								<goals>
									<goal>java</goal>
								</goals>
							</execution>
						</executions>
						<configuration>
							<mainClass>org.jboss.tck.spec.mapper.Mapper</mainClass>
							<systemProperties>
								<property>
									<key>spec.html.path</key>
									<value>${path.to.cdi.spec}</value>
								</property>
								<property>
									<key>tck.audit.url</key>
									<value>${tck.audit.url}</value>
								</property>
								<property>
									<key>tck.coverage.url</key>
									<value>${tck.coverage.url}</value>
								</property>
								<property>
									<key>tck.version</key>
									<value>${tck.version}</value>
								</property>
								<property>
									<key>new.spec.filename</key>
									<value>${project.build.directory}/generated-docs/cdi-spec-with-assertions.html</value>
								</property>
							</systemProperties>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

	<build>
		<defaultGoal>clean package</defaultGoal>
		<plugins>
			<plugin>
				<groupId>org.asciidoctor</groupId>
				<artifactId>asciidoctor-maven-plugin</artifactId>
				<version>${asciidoctor-maven.version}</version>
				<dependencies>
					<dependency>
						<groupId>org.asciidoctor</groupId>
						<artifactId>asciidoctorj-pdf</artifactId>
						<version>${asciidoctorj-pdf.version}</version>
					</dependency>
				</dependencies>
				<executions>
					<execution>
						<id>generate-pdf-doc</id>
						<phase>generate-resources</phase>
						<goals>
							<goal>process-asciidoc</goal>
						</goals>
						<configuration>
							<backend>pdf</backend>
						</configuration>
					</execution>
					<execution>
						<id>output-html</id>
						<phase>generate-resources</phase>
						<goals>
							<goal>process-asciidoc</goal>
						</goals>
						<configuration>
							<backend>html5</backend>
							<doctype>book</doctype>
							<attributes>
								<docinfo>shared</docinfo>
							</attributes>
						</configuration>
					</execution>
				</executions>
				<configuration>
					<sourceDocumentName>cdi-spec.asciidoc</sourceDocumentName>
					<sourceHighlighter>coderay</sourceHighlighter>
					<attributes>
						<license>${license-file}</license>
					</attributes>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-deploy-plugin</artifactId>
				<version>3.0.0-M1</version>
				<configuration>
					<skip>true</skip>
				</configuration>
			</plugin>
		</plugins>
	</build>
</project>
