C.4. OpenShift Maven プラグインのインストール
このプラグインは Maven の中央リポジトリーで使用でき、以下のようにインテグレーション前後のフェーズに接続することができます。デフォルトでは、Maven は org.apache.maven.plugins パッケージおよび org.codehaus.mojo パッケージ内のプラグインのみを検索します。JKube プラグインゴールのプロバイダーを解決するには、~/.m2/settings.xml
ファイルを編集し、org.eclipse.jkube
namespace を <pluginGroups> 設定に追加します。
手順
-
OpenShift Maven プラグインをインテグレーション前およびインテグレーション後のフェーズに接続するには、以下の
~/.m2/settings.xml
ファイルを追加します。
<settings> ... <pluginGroups> <pluginGroup>org.jboss.redhat-fuse</pluginGroup> </pluginGroups> ... </settings> <plugin> <groupId>org.jboss.redhat-fuse</groupId> <artifactId>openshift-maven-plugin</artifactId> <version>${fuse.version}</version> <configuration> .... <images> <!-- A single's image configuration --> <image> ... <build> .... </build> </image> .... </images> </configuration> <!-- Connect oc:resource, oc:build and oc:helm to lifecycle phases --> <executions> <execution> <id>jkube</id> <goals> <goal>resource</goal> <goal>build</goal> <goal>helm</goal> </goals> </execution> </executions> </plugin>
<settings>
...
<pluginGroups>
<pluginGroup>org.jboss.redhat-fuse</pluginGroup>
</pluginGroups>
...
</settings>
<plugin>
<groupId>org.jboss.redhat-fuse</groupId>
<artifactId>openshift-maven-plugin</artifactId>
<version>${fuse.version}</version>
<configuration>
....
<images>
<!-- A single's image configuration -->
<image>
...
<build>
....
</build>
</image>
....
</images>
</configuration>
<!-- Connect oc:resource, oc:build and oc:helm to lifecycle phases -->
<executions>
<execution>
<id>jkube</id>
<goals>
<goal>resource</goal>
<goal>build</goal>
<goal>helm</goal>
</goals>
</execution>
</executions>
</plugin>