views:

622

answers:

2

I have maven-plagin and need to run goal, that should automatically run before plugin. It possible?

+1  A: 

You can script it out and string it together like this:

mvn clean assembly:assembly

for example...

javamonkey79
+3  A: 

If you always want to execute a goal at a specific point during the build you can add the following to your pom.xml. The really interesting part is the <phase>...</phase> tag, where you can specify the exact point when the goal shall be executed.

<build>
    <plugins>
        <plugin>
            <groupId>com.foo</groupId>
            <artifactId>bar-plugin</artifactId>
            <executions>
                <execution>
                    <phase>validate</phase>
                    <goals>
                        <goal>foobargoal</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

For more information see the Maven documentation.

Roland Schneider