Hi,
In my current project we use some plugins needed by other plugins parameters like properties-maven-plugin or buildnumber-plugin.
<?xml version="1.0"?>
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>mygroup</groupId>
<artifactId>myartifact</artifactId>
<packaging>pom</packaging>
<version>v0</version>
<name>myProject</name>
<properties>
<env>dev</env>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0-alpha-2</version>
<configuration>
<files>
<file>${basedir}/configurations/${env}.properties</file>
</files>
</configuration>
<executions>
<execution>
<phase>initialize</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<version>1.0-beta-3</version>
<executions>
<execution>
<phase>initialize</phase>
<goals>
<goal>create</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.wakaleo.schemaspy</groupId>
<artifactId>maven-schemaspy-plugin</artifactId>
<version>1.0</version>
<configuration>
<databaseType>mysql</databaseType>
<database>${database.schema}</database>
<host>${database.host}</host>
<user>${database.user}</user>
<password>${database.pwd}</password>
</configuration>
</plugin>
</plugins>
</build>
</project>
The problem is that when you execute directly a plugin goal, goals binded on the initialize phase (or validate) are not executed. So to generate schema spy we need to type:
$> mvn org.codehaus.mojo:properties-maven-plugin:read-project-properties schemaspy:schemaspy
We want to tell that properties plugin and buildNumber plugin need to be executed for every maven command so we can type:
$> mvn schemaspy:schemaspy
Is there a clean way to do that (without scripting) ?