<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>javax.batch</groupId>
		<artifactId>jbatch</artifactId>
		<version>1.0.1-b01</version>
	</parent>
	<groupId>com.ibm.jbatch</groupId>
	<artifactId>com.ibm.jbatch.container</artifactId>
	<packaging>jar</packaging>
	<version>1.0.1-b01</version>
	<name>com.ibm.jbatch.container</name>
	<url>http://maven.apache.org</url>

	<properties>
		<version.ant.ant-nodeps>1.6.5</version.ant.ant-nodeps>
	</properties>

	<dependencies>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>javax.batch</groupId>
			<artifactId>javax.batch-api</artifactId>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>com.ibm.jbatch</groupId>
			<artifactId>com.ibm.jbatch.spi</artifactId>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>javax.enterprise</groupId>
			<artifactId>cdi-api</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.jboss.weld.se</groupId>
			<artifactId>weld-se</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>javax.transaction</groupId>
			<artifactId>jta</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.derby</groupId>
			<artifactId>derby</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<profiles>
		<profile>
			<id>JavaEE</id>
			<build>
				<resources>
					<resource>
						<directory>src/main/resources</directory>
						<excludes>
							<exclude>*-properties/**</exclude>
						</excludes>
					</resource>
				</resources>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-compiler-plugin</artifactId>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-resources-plugin</artifactId>
					</plugin>
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>jaxb2-maven-plugin</artifactId>
						<executions>
							<execution>
								<id>xjc</id>
								<goals>
									<goal>xjc</goal>
								</goals>
								<configuration>
									<schemaDirectory>src/main/resources/xsd</schemaDirectory>
									<schemaFiles>jobXML_1_0.xsd</schemaFiles>
									<target>2.1</target>
								</configuration>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-jar-plugin</artifactId>
						<configuration>
							<archive>
								<manifestFile>META-INF/MANIFEST.MF</manifestFile>
							</archive>
						</configuration>
					</plugin>
					<plugin>
						<artifactId>maven-antrun-plugin</artifactId>
						<executions>
							<execution>
								<phase>validate</phase>
								<configuration>
									<tasks>
										<echo>Java EE Build</echo>
										<copy overwrite="true"
											file="src/main/resources/ee-properties/batch-config.properties"
											tofile="src/main/resources/META-INF/services/batch-config.properties" />
										<copy overwrite="true"
											file="src/main/resources/ee-properties/batch-services.properties"
											tofile="src/main/resources/META-INF/services/batch-services.properties" />
									</tasks>
								</configuration>
								<goals>
									<goal>run</goal>
								</goals>
							</execution>
							<execution>
								<id>ant-process-sources</id>
								<phase>process-sources</phase>
								<configuration>
									<tasks>
										<echo>Adjusting generated JAXBs</echo>
										<ant antfile="${basedir}/adjustJAXB/build.xml" />
									</tasks>
								</configuration>
								<goals>
									<goal>run</goal>
								</goals>
							</execution>
						</executions>
						<dependencies>
							<dependency>
								<groupId>ant</groupId>
								<artifactId>ant-nodeps</artifactId>
								<version>${version.ant.ant-nodeps}</version>
							</dependency>
						</dependencies>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>JavaSE</id>

			<activation>
				<activeByDefault>true</activeByDefault>
			</activation>

			<build>
				<resources>
					<resource>
						<directory>src/main/resources</directory>
						<excludes>
							<exclude>*-properties/**</exclude>
						</excludes>
					</resource>
				</resources>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-compiler-plugin</artifactId>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-resources-plugin</artifactId>
					</plugin>
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>properties-maven-plugin</artifactId>
						<version>1.0-alpha-2</version>
						<executions>
							<execution>
								<id>set-additional-system-properties</id>
								<goals>
									<goal>set-system-properties</goal>
								</goals>
								<configuration>
									<properties>
										<property>
											<name>javax.xml.accessExternalSchema</name>
											<value>file</value>
										</property>
									</properties>
								</configuration>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>jaxb2-maven-plugin</artifactId>
						<executions>
							<execution>
								<id>xjc</id>
								<goals>
									<goal>xjc</goal>
								</goals>
								<configuration>
									<schemaDirectory>src/main/resources/xsd</schemaDirectory>
									<schemaFiles>jobXML_1_0.xsd</schemaFiles>
									<target>2.1</target>
								</configuration>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-jar-plugin</artifactId>
						<configuration>
							<archive>
								<manifestFile>META-INF/MANIFEST.MF</manifestFile>
							</archive>
						</configuration>
					</plugin>
					<plugin>
						<artifactId>maven-antrun-plugin</artifactId>
						<executions>
							<execution>
								<phase>validate</phase>
								<configuration>
									<tasks>
										<echo>Java SE Build</echo>
										<copy overwrite="true"
											file="src/main/resources/se-properties/META-INF/services/batch-config.properties"
											tofile="src/main/resources/META-INF/services/batch-config.properties" />
										<copy overwrite="true"
											file="src/main/resources/se-properties/META-INF/services/batch-services.properties"
											tofile="src/main/resources/META-INF/services/batch-services.properties" />
									</tasks>
								</configuration>
								<goals>
									<goal>run</goal>
								</goals>
							</execution>
							<execution>
								<id>ant-process-sources</id>
								<phase>process-sources</phase>
								<configuration>
									<tasks>
										<echo>Adjusting generated JAXBs</echo>
										<ant antfile="${basedir}/adjustJAXB/build.xml" />
									</tasks>
								</configuration>
								<goals>
									<goal>run</goal>
								</goals>
							</execution>
						</executions>
						<dependencies>
							<dependency>
								<groupId>ant</groupId>
								<artifactId>ant-nodeps</artifactId>
								<version>${version.ant.ant-nodeps}</version>
							</dependency>
						</dependencies>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>

