<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>
		<artifactId>jboss-seam-parent</artifactId>
		<groupId>org.jboss.seam</groupId>
		<version>2.3.1.Final</version>
		<relativePath>../pom.xml</relativePath>
	</parent>
	
	<artifactId>seam-reference-guide</artifactId>
	<name>Seam Reference Guide</name>
	<packaging>jar</packaging>

	<build>
		<defaultGoal>process-classes</defaultGoal>
        <!-- this filters docbook xml files to replace project.version with real Seam version -->
        <resources>
            <resource>
                <directory>${project.basedir}/src/docbook</directory>
                <filtering>true</filtering>
                <includes>
                    <include>**/*.xml</include>
                </includes>
            </resource>
        </resources>
		<plugins>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<executions>
					<execution>
						<id>attach-zip</id>
						<phase>package</phase>
						<goals>
							<goal>attach-artifact</goal>
						</goals>
						<configuration>
							<artifacts>
								<artifact>
									<file>${project.build.outputDirectory}/${project.artifactId}.war</file>
									<type>zip</type>
								</artifact>
							</artifacts>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.jboss.maven.plugins</groupId>
				<artifactId>maven-jdocbook-plugin</artifactId>
				<version>2.2.0</version>
				<extensions>true</extensions>
				<executions>
					<execution>
						<id>jdocbook:generate</id>
						<phase>compile</phase>
						<goals>
							<goal>generate</goal>
						</goals>
					</execution>
					<execution>
						<id>jdocbook:resources</id>
						<phase>process-resources</phase>
						<goals>
							<goal>resources</goal>
						</goals>
					</execution>
					<execution>
						<id>jdocbook:bundle</id>
						<phase>package</phase>
						<goals>
							<goal>bundle</goal>
						</goals>
					</execution>
				</executions>
				<dependencies>
					<dependency>
						<groupId>org.jboss.seam</groupId>
						<artifactId>seam-docbook-xslt</artifactId>
						<version>${seam.docbook.version}</version>
						<exclusions>
							<exclusion>
								<groupId>org.eclipse.wst.css</groupId>
								<artifactId>core</artifactId>
							</exclusion>
							<exclusion>
								<groupId>org.eclipse.wst.sse</groupId>
								<artifactId>core</artifactId>
							</exclusion>
						</exclusions>
					</dependency>
					<dependency>
						<groupId>org.jboss.seam</groupId>
						<artifactId>seam-jdocbook-style</artifactId>
						<version>${seam.docbook.version}</version>
						<type>jdocbook-style</type>
					</dependency>
					<dependency>
						<groupId>org.jboss</groupId>
						<artifactId>jbossorg-jdocbook-style</artifactId>
						<version>${jbossorg.docbook.version}</version>
						<type>jdocbook-style</type>
					</dependency>
					 <dependency>
			            <!-- DocBook (this is the version used, unless user project imports one...) -->
			            <groupId>net.sf.docbook</groupId>
			            <artifactId>docbook</artifactId>
			            <version>1.74.0</version>
			        </dependency>
					
				</dependencies>
				<configuration>
					<sourceDirectory>${project.build.outputDirectory}</sourceDirectory>
					<sourceDocumentName>master.xml</sourceDocumentName>
					<masterTranslation>en-US</masterTranslation>

					<imageResource>
						<directory>${project.basedir}/src/docbook/en-US</directory>
						<includes>
							<include>images/*.png</include>
						</includes>
					</imageResource>
					<formats>
						<format>
							<formatName>pdf</formatName>
							<stylesheetResource>classpath:/xslt/org/jboss/seam/pdf.xsl</stylesheetResource>
							<finalName>${pdf.name}</finalName>
						</format>
						<format>
							<formatName>html</formatName>
							<stylesheetResource>classpath:/xslt/org/jboss/seam/xhtml.xsl</stylesheetResource>
							<finalName>index.html</finalName>
						</format>
						<format>
							<formatName>html_single</formatName>
							<stylesheetResource>classpath:/xslt/org/jboss/seam/xhtml-single.xsl</stylesheetResource>
							<finalName>index.html</finalName>
						</format>
					</formats>
					<options>
	                  <xincludeSupported>true</xincludeSupported>
	                  <xmlTransformerType>saxon</xmlTransformerType>
	                  <applyStandardInjectionValues>false</applyStandardInjectionValues>
	                  <docbookVersion>1.72.0</docbookVersion>
	                  <transformerParameters>
	                     <property>
	                        <name>javax.xml.parsers.DocumentBuilderFactory</name>
	                        <value>org.apache.xerces.jaxp.DocumentBuilderFactoryImpl</value>
	                     </property>
	                     <property>
	                        <name>javax.xml.parsers.SAXParserFactory</name>
	                        <value>org.apache.xerces.jaxp.SAXParserFactoryImpl</value>
	                     </property>
	                  </transformerParameters>
	                  <localeSeparator>-</localeSeparator>
                    </options>
				</configuration>
			</plugin>
		</plugins>
	</build>

	<profiles>
		<profile>
			<activation>
				<property>
					<name>build.translations</name>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.jboss.maven.plugins</groupId>
						<artifactId>maven-jdocbook-plugin</artifactId>
						<configuration>
							<translations>
								<translation>fr-FR</translation>
								<translation>it-IT</translation>
								<translation>ja-JP</translation>
							</translations>
						</configuration>
						<executions>
							<execution>
								<phase>process-resources</phase>
								<goals>
									<goal>translate</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

</project>
