私の現在のプロジェクトでは、properties-maven-plugin や 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>
問題は、プラグインのゴールを直接実行すると、初期化フェーズ (または検証) でバインドされたゴールが実行されないことです。したがって、スキーマ スパイを生成するには、次のように入力する必要があります。
$> mvn org.codehaus.mojo:properties-maven-plugin:read-project-properties schemaspy:schemaspy
次のように入力できるように、すべての maven コマンドに対してプロパティ プラグインと buildNumber プラグインを実行する必要があることを伝えたいと思います。
$> mvn schemaspy:schemaspy
(スクリプトなしで)それを行うためのきれいな方法はありますか?