Maven 成果物としてのインストール

Liberty サーバーを、Maven 成果物としてインストールできます。Maven 成果物としてインストールするには、Maven インストール・プラグインを使用する方法と、Liberty アセンブリーのパッケージ化メソッドを使用する方法の 2 つのオプションがあります。

Maven インストール・プラグインの使用

使用法:

maven-install-plugin を使用して、Liberty サーバー・ファイルを含む圧縮アーカイブを Maven 成果物としてインストールできます。圧縮アーカイブは、例えば liberty:package-server ゴールによって生成できます。

例: コマンド行の使用
mvn install:install-file
    -Dfile=/opt/ibm/wlp.zip ¥
    -DgroupId=myGroup ¥
    -DartifactId=myServer ¥
    -Dversion=1.0 ¥
    -Dpackaging=zip ¥
例: pom.xml の使用
これは、プロジェクトの pom.xml ファイル内で使用できるコード・スニペットです。
...
<plugin>
    <!-- Install the Liberty server zip into the local Maven repository -->
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-install-plugin</artifactId>
    <version>2.2</version>
    <executions>
        <execution>
            <id>install-liberty-to-repo</id>
            <phase>process-resources</phase>
            <goals>
                <goal>install-file</goal>
            </goals>
            <configuration>
                <file>/opt/ibm/wlp.zip</file>
                <groupId>myGroup</groupId>
                <artifactId>myServer</artifactId>
                <version>1.0</version>
                <packaging>zip</packaging>
           </configuration>
       </execution>
</plugin>
...

Liberty アセンブリーの使用

使用法:

liberty-assembly パッケージ化タイプを使用して、既存のサーバー・インストール済み環境、圧縮アーカイブ、または別のサーバーの Maven 成果物から、Liberty サーバーの Maven 成果物を作成できます。 Maven compile 依存関係として指定されたアプリケーションはすべて、dropins/ ディレクトリー内のアセンブル済みサーバーと共に自動的にパッケージ化されます。

例: liberty-assembly パッケージ化タイプの使用
これは、プロジェクトの pom.xml ファイル内で使用できるコード・スニペットです。
<project>
    ...
    <groupId>myGroup</groupId>
    <artifactId>myServer</artifactId>
    <!-- Create Liberty server assembly -->
    <packaging>liberty-assembly</packaging>
    ...
    <dependencies>
        <!-- Package SimpleServlet.war with server assembly -->
        <dependency>
            <groupId>wasdev</groupId>
            <artifactId>SimpleServlet</artifactId>
            <version>1.0</version>
            <type>war</type>
        </dependency>
    </dependencies>
    ...
    <build>
        <plugins>
            <!-- Enable liberty-maven-plugin -->
            <plugin>
                <groupId>com.ibm.websphere.wlp.maven.plugins</groupId>
                <artifactId>liberty-maven-plugin</artifactId> 
                <version>1.0</version>
                <extensions>true</extensions>
                <configuration>
                    <serverHome>/opt/ibm/wlp</serverHome>
                    <serverName>test</serverName>
                </configuration>         
            </plugin>
        </plugins>
    </build>        
    ...        
</project>

トピックのタイプを示すアイコン 参照トピック



タイム・スタンプ・アイコン 最終更新: Monday, 5 December 2016
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-libcore-mp&topic=rwlp_maven_artifact
ファイル名: rwlp_maven_artifact.html