プロジェクトのバージョンを更新するには、versions-maven-plugin を使用します。この更新されたバージョンでアーティファクトをインストールしたいのですが、maven-install プラグインは古いバージョンを使用しています。説明されている動作を実現するには、プロジェクトをどのように構成する必要がありますか?
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>parse-version</goal>
</goals>
</execution>
</executions>
<configuration>
<propertyPrefix>parsedVersion</propertyPrefix>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<executions>
<execution>
<id>update-version</id>
<phase>validate</phase>
<goals>
<goal>set</goal>
<goal>commit</goal>
</goals>
<configuration>
<newVersion>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}-${SVN_REVISION}</newVersion>
</configuration>
</execution>
</executions>
</plugin>
通常、Maven のライフサイクルに関しては、バージョン プラグインはフェーズ検証で実行されるため、インストール プラグインは新しいバージョンを取得する必要があります。