<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>com.ibm.jbatch</groupId>
        <artifactId>jbatch-parent</artifactId>
        <version>2.1.1</version>
    </parent>
    <groupId>com.ibm.jbatch</groupId>
    <artifactId>com.ibm.jbatch.container</artifactId>
    <packaging>jar</packaging>
    <name>Jakarta Batch jbatch Implementation</name>
    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>jakarta.batch</groupId>
            <artifactId>jakarta.batch-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.ibm.jbatch</groupId>
            <artifactId>com.ibm.jbatch.spi</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>jakarta.xml.bind</groupId>
            <artifactId>jakarta.xml.bind-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jaxb</groupId>
            <artifactId>jaxb-runtime</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>jakarta.enterprise</groupId>
            <artifactId>jakarta.enterprise.cdi-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.weld.se</groupId>
            <artifactId>weld-se-core</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>jakarta.transaction</groupId>
            <artifactId>jakarta.transaction-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.derby</groupId>
            <artifactId>derby</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <build>
        <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>build-helper-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>generated-sources</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <!-- Building JAXB model manually for now -->
            <!--
            <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-dependency-plugin</artifactId>
                <version>${version.org.apache.maven.plugins.maven-dependency-plugin}</version>
                <executions>
                    <execution>
                        <id>unpack</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
            <groupId>jakarta.batch</groupId>
            <artifactId>jakarta.batch-api</artifactId>
                                <version>${batch.api.version}</version>
                                    <type>jar</type>
                                    <includes>xsd/*.*</includes>
                                </artifactItem>
                            </artifactItems>
                            <outputDirectory>${project.build.directory}/classes</outputDirectory>
                            <overWriteReleases>true</overWriteReleases>
                            <overWriteSnapshots>false</overWriteSnapshots>
                            <overWriteIfNewer>true</overWriteIfNewer>
                        </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>
            <!-- Building JAXB model manually for now -->
            <!--
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <id>ant-process-sources</id>
                        <phase>process-sources</phase>
                        <configuration>
                            <target>
                                <echo>Adjusting generated JAXBs</echo>
                                <ant antfile="${project.basedir}/adjustJAXB/build.xml" />
                            </target>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            -->
            <!-- The main reason for using both the failsafe and surefire plugins 
                is to allow some tests to be run all under a single JVM lifecycle, and some 
                to be run with each test getting its own JVM instance. It's not because one 
                set of tests is more "unit test"-like and one set more "integration test"-like. -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <!-- Must be false for tests of service manager/registry since they 
                        assume they are not dealing with an earlier config from another test -->
                    <reuseForks>false</reuseForks>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <systemPropertyVariables>
                        <com.ibm.jbatch.spi.ServiceRegistry.J2SE_MODE>true</com.ibm.jbatch.spi.ServiceRegistry.J2SE_MODE>
                        <com.ibm.jbatch.spi.ServiceRegistry.BATCH_THREADPOOL_SERVICE>com.ibm.jbatch.container.services.impl.GrowableThreadPoolServiceImpl</com.ibm.jbatch.spi.ServiceRegistry.BATCH_THREADPOOL_SERVICE>
                        <com.ibm.jbatch.spi.ServiceRegistry.CONTAINER_ARTIFACT_FACTORY_SERVICE>com.ibm.jbatch.container.services.impl.DelegatingBatchArtifactFactoryImpl</com.ibm.jbatch.spi.ServiceRegistry.CONTAINER_ARTIFACT_FACTORY_SERVICE>
                        <java.util.logging.config.file>${build.testOutputDirectory}/logging.properties</java.util.logging.config.file>

                    </systemPropertyVariables>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <profiles>
        <profile>
            <id>jdk8</id>
            <activation>
                <activeByDefault>false</activeByDefault>
                <jdk>[1.8,)</jdk>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <configuration>
                            <!-- xjc uses > rather than &gt for closing tags in a generated classes 
                                javadoc -->
                            <additionalparam>-Xdoclint:none</additionalparam>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>properties-maven-plugin</artifactId>
                        <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>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>

