<?xml version="1.0" encoding="UTF-8"?>
<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>
        <groupId>com.github.davidmoten</groupId>
        <artifactId>odata-client-parent</artifactId>
        <version>0.1.13</version>
    </parent>
    <artifactId>odata-client-test-unit</artifactId>
    <name>${project.artifactId}</name>
    <description>OData client generation test</description>

    <dependencies>

        <dependency>
            <groupId>com.github.davidmoten</groupId>
            <artifactId>odata-client-runtime</artifactId>
            <version>${project.parent.version}</version>
        </dependency>

        <!-- Test Dependencies -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.github.davidmoten</groupId>
            <artifactId>junit-extras</artifactId>
            <version>0.3</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>3.2.4</version>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>${release.plugin.version}</version>
                <configuration>
                    <skip>true</skip>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.github.davidmoten</groupId>
                <artifactId>odata-client-maven-plugin</artifactId>
                <version>${project.parent.version}</version>
                <executions>
                    <execution>
                        <id>test1</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <metadata>src/main/odata/metadata1.xml</metadata>
                        </configuration>
                    </execution>
                    <execution>
                        <id>test2</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <metadata>src/main/odata/metadata2.xml</metadata>
                        </configuration>
                    </execution>
                    <execution>
                        <id>test3</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <metadata>src/main/odata/metadata3.xml</metadata>
                            <schemas>
                                <schema>
                                    <namespace>Test3.A</namespace>
                                    <packageName>test3a</packageName>
                                </schema>
                                <schema>
                                    <namespace>Test3.B</namespace>
                                    <packageName>test3b</packageName>
                                </schema>
                            </schemas>
                        </configuration>
                    </execution>
                    <execution>
                        <id>test4</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <metadata>src/main/odata/metadata4.xml</metadata>
                        </configuration>
                    </execution>
                    <execution>
                        <id>test5</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <metadata>src/main/odata/metadata5.xml</metadata>
                        </configuration>
                    </execution>
                    <execution>
                        <id>test6</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <metadata>src/main/odata/metadata6.xml</metadata>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>3.0.0</version>
                <executions>
                    <execution>
                        <id>add-source</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>${project.build.directory}/generated-sources/java</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <pluginManagement>
            <plugins>
                <!--This plugin's configuration is used to store Eclipse 
                    m2e settings only. It has no influence on the Maven build itself. -->
                <plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>
                                            com.github.davidmoten
                                        </groupId>
                                        <artifactId>
                                            odata-client-maven-plugin
                                        </artifactId>
                                        <versionRange>
                                            [0.1-SNAPSHOT,)
                                        </versionRange>
                                        <goals>
                                            <goal>generate</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore />
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
</project>
