<?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.telenav.cactus.metadata</groupId>
        <artifactId>cactusmetadata-parent</artifactId>
        <version>1.0.3</version>
    </parent>

    <artifactId>cactusmetadata-maven-plugin</artifactId>
    <packaging>maven-plugin</packaging>

    <description>Generates build.properties and project.properties into target/classes.</description>

    <dependencies>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>cactusmetadata</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-plugin-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.plugin-tools</groupId>
            <artifactId>maven-plugin-annotations</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-core</artifactId>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-plugin-plugin</artifactId>
                    <version>${maven.plugin.plugin.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-plugin-plugin</artifactId>
                <configuration>
                    <goalPrefix>cactus-metadata</goalPrefix>
                </configuration>
                <executions>
                    <!-- We need this for release, so that we can use compile, but
                         but not install, to pre-generate the plugin descriptor so that
                         the rest of the build, which will use this plugin from
                         target/classes, does not fail because there is no plugin.xml
                         in META-INF.  Harmless to do it earlier, since we're not using
                         any odd scripting languages.
                    -->
                    <execution>
                        <id>mojo-descriptor-compile-time</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>descriptor</goal>
                        </goals>
                    </execution>

                    <execution>
                        <id>mojo-descriptor</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>descriptor</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>generated-helpmojo</id>
                        <goals>
                            <goal>helpmojo</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
