Export to GitHub

maven-aggregate-plugin - Usage.wiki


Introduction

Sometimes we need to run a set of plugins - one, than other, than one again. You can't do it using standard Maven configuration (really!), but you can use this plugin. See a Details section for a compete example.

Details

Try to use following pom.xml file as an example of how this plugin works ``` http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 ru.mipt.test TestProject pom 2.0-SNAPSHOT

<repositories>
            <!-- Repo for mojo-executor dependency -->
    <repository>
        <id>mojo-executor-repository</id>
        <name>Mojo Executor Repository for Maven</name>
        <url>http://mojo-executor.googlecode.com/svn/repo/</url>
    </repository>

            <!-- MavenAggregatePlugin plugin repo -->
    <repository>
        <id>maven-aggregate-plugin-repository</id>
        <name>Maven Aggregate Plugin Repository for Maven</name>
        <url>http://maven-aggregate-plugin.googlecode.com/svn/trunk/</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        <version>1.3</version>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>ru.ya.kolemik</groupId>
            <artifactId>maven-aggregate-plugin</artifactId>
            <version>1.0-SNAPSHOT</version>
            <executions>
                <execution>
                    <id>1</id>
                    <phase>package</phase>
                    <goals>
                        <goal>run</goal>
                    </goals>
                    <configuration>
                        <plugins>
                            <plugin>
                                <artifactId>maven-dependency-plugin</artifactId>
                                <groupId>org.apache.maven.plugins</groupId>
                                <version>2.0</version>
                                <goal>copy-dependencies</goal>
                                <configuration>
                                    <outputDirectory>${project.build.directory}/foo</outputDirectory>
                                </configuration>
                            </plugin>
                            <plugin>
                                <artifactId>maven-antrun-plugin</artifactId>
                                <goal>run</goal>
                                <configuration>
                                    <tasks>
                                        <echo>Hello from Ant!</echo>
                                    </tasks>
                                </configuration>
                            </plugin>
                            <plugin>
                                <artifactId>maven-dependency-plugin</artifactId>
                                <groupId>org.apache.maven.plugins</groupId>
                                <version>2.0</version>
                                <goal>copy-dependencies</goal>
                                <configuration>
                                    <outputDirectory>${project.build.directory}/bar</outputDirectory>
                                </configuration>
                            </plugin>
                        </plugins>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

```