<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>
	<groupId>org.cip4.lib.xprinttalk</groupId>
	<artifactId>xPrintTalkLib</artifactId>
	<version>0.3</version>
	<packaging>jar</packaging>
	<name>xPrintTalkLib</name>
	<url>http://maven.apache.org</url>
	
	<parent>
		<groupId>org.cip4.tools</groupId>
		<artifactId>xCIP4Master</artifactId>
		<version>1.0</version>
	</parent>
	
	<licenses>
		<license>
			<name>CIP4 Software License</name>
			<url>http://www.cip4.org/open_source/cip4_software_license_v2.html</url>
			<distribution>repo</distribution>
		</license>
	</licenses>
	<scm>
		<url>http://svn.cip4.org/svnroot/tags/xPrintTalkLib-0.3</url>
		<developerConnection>scm:svn:http://svn.cip4.org/svnroot/tags/xPrintTalkLib-0.3</developerConnection>
		<connection>scm:svn:http://svn.cip4.org/svnroot/tags/xPrintTalkLib-0.3</connection>
	</scm>
	<issueManagement>
		<system>JIRA</system>
		<url>http://jira.cip4.org/jira/browse/XJDFLIB</url>
	</issueManagement>
	<reporting>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-changes-plugin</artifactId>
				<version>2.6</version>
				<reportSets>
					<reportSet>
						<reports>
							<report>changes-report</report>
						</reports>
					</reportSet>
				</reportSets>
			</plugin>
		</plugins>
	</reporting>
	<developers>
		<developer>
			<id>r.prosi</id>
			<name>Dr. Rainer Prosi</name>
			<organization>Heidelberger Druckmaschinen AG</organization>
			<organizationUrl>http://www.heidelberg.com</organizationUrl>
			<email>rainer.prosi@heidelberg.com</email>
		</developer>
		<developer>
			<id>s.meissner</id>
			<name>Stefan Meissner</name>
			<organization>flyeralarm GmbH</organization>
			<organizationUrl>http://www.flyeralarm.com</organizationUrl>
			<email>s.meissner@flyeralarm.de</email>
		</developer>
	</developers>
	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>2.3</version>
				<configuration>
					<source>1.6</source>
					<target>1.6</target>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-release-plugin</artifactId>
				<version>2.2.2</version>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-gpg-plugin</artifactId>
				<version>1.4</version>
			</plugin>

			
			<!-- doc book generation -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>com.agilejava.docbkx</groupId>
				<artifactId>docbkx-maven-plugin</artifactId>
			</plugin>
			<plugin>
				<artifactId>maven-assembly-plugin</artifactId>
				<version>${maven-assembly-plugin.version}</version>
				<executions>
					<execution>
						<id>zip documentation</id>
						<phase>prepare-package</phase>
						<goals>
							<goal>single</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<finalName>${project.artifactId}-${project.version}</finalName>
					<appendAssemblyId>false</appendAssemblyId>
					<descriptors>
						<descriptor>${workDirectory}/assembly/userguide-zip.xml</descriptor>
					</descriptors>
				</configuration>
			</plugin>

			<!-- Ant Script: Update XSD -->
			<plugin>
				<artifactId>maven-antrun-plugin</artifactId>
				<version>1.7</version>
				<executions>
					<execution>
						<id>default-cli</id>
						<configuration>
							<target>
								<!-- Prepare -->
								<echo message="Remove old directory" />
								<delete dir="target/generated-sources/jaxb" />
								<mkdir dir="target/generated-sources/jaxb" />
								
								<!-- Generate java classes from XSD -->
								<echo message="Generate classes..." />
								<property environment="env" />
								<property name="jdk.dir" value="${env.JAVA_HOME}" />
								<exec executable="${jdk.dir}/bin/xjc.exe"> 
									<!-- binding file -->
									<arg value="-b" /> 
							        <arg value="src/main/resources/org/cip4/lib/xprinttalk/binding.xjb" />
							        
							        <!-- further arguments --> 
							        <arg value="-no-header" />
							        <arg value="-extension" />
							        
							        <!-- target directory -->
							        <arg value="-d" /> 
							        <arg value="target\generated-sources\jaxb" /> 
									
									<!-- XSD -->
							        <arg value="src/main/resources/org/cip4/lib/xprinttalk/xsd/PrintTalk20.xsd" /> 
							    </exec> 
								
								<!-- Adjust package names -->
								<echo message="Modify package names..." />
								<replace dir="target/generated-sources/jaxb/org/cip4/lib/xprinttalk/schema" value="org.cip4.lib.xjdf.schema">
									<include name="**/*.java" />
									<replacetoken>org.cip4.jdfschema_2_0</replacetoken>
								</replace>

								<!-- Remove old classes -->
								<echo message="Remove old classes..." />
								<delete>
									<fileset dir="src/main/java/org/cip4/lib/xprinttalk/schema" includes="**/*.java" />
								</delete>

								<!-- Copy new classes to target location -->
								<echo message="Copy new classes to target location..." />
								<copy todir="src/main/java/org/cip4/lib/xprinttalk/schema">
									<fileset dir="target/generated-sources/jaxb/org/cip4/lib/xprinttalk/schema" />
								</copy>
								
								<!-- clean up -->
								<echo message="Clean up" />
								<delete dir="target\generated-sources\jaxb" />
							</target>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
	<dependencies>
		<dependency>
			<groupId>org.cip4.lib.xjdf</groupId>
			<artifactId>xJdfLib</artifactId>
			<version>0.3</version>
		</dependency>
		<dependency>
			<groupId>javax.xml.bind</groupId>
			<artifactId>jaxb-api</artifactId>
			<version>2.2.6</version>
		</dependency>
		<!-- Apache Tools <dependency> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> 
			<version>2.1</version> </dependency> -->
		<dependency>
			<groupId>com.sun.xml.bind</groupId>
			<artifactId>jaxb-impl</artifactId>
			<version>2.2.5-2</version>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.10</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>commons-lang</groupId>
			<artifactId>commons-lang</artifactId>
			<version>2.6</version>
			<scope>test</scope>
		</dependency>
	</dependencies>
</project>
