<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.coxautodev</groupId>
        <artifactId>apollo-client-maven-plugin-parent</artifactId>
        <version>1.1.2</version>
        <relativePath>..</relativePath>
    </parent>

    <artifactId>apollo-client-maven-plugin</artifactId>
    <version>1.1.2</version>
    <packaging>maven-plugin</packaging>

    <name>apollo-client-maven-plugin</name>
    <description>Maven plugin for generating graphql clients</description>
    <url>https://github.com/Cox-Automotive/apollo-client-maven-plugin</url>

    <dependencies>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-plugin-api</artifactId>
            <version>3.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.plugin-tools</groupId>
            <artifactId>maven-plugin-annotations</artifactId>
            <version>3.4</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-project</artifactId>
            <version>2.2.1</version>
        </dependency>

        <dependency>
            <groupId>com.apollographql.apollo</groupId>
            <artifactId>compiler</artifactId>
            <version>0.4.0</version>
        </dependency>

        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.5</version>
        </dependency>
        <dependency>
            <groupId>org.reflections</groupId>
            <artifactId>reflections</artifactId>
            <version>0.9.11</version>
        </dependency>
    </dependencies>

    <build>
        <resources>
            <resource>
                <directory>${project.build.directory}/node_modules</directory>
                <targetPath>node_modules</targetPath>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>1.6.0</version>
                <executions>
                    <execution>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <executable>npm</executable>
                    <workingDirectory>${project.build.directory}</workingDirectory>
                    <arguments>
                        <argument>install</argument>
                        <argument>apollo-codegen</argument>
                    </arguments>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>