Maven 目標 - liberty:install-apps

您可以利用 liberty:install-apps 目標,將一或多個應用程式複製到 Liberty 伺服器中。

liberty:install-apps 目標會將指定為 Maven 相依關係的應用程式,複製到 Liberty 伺服器的 dropins/ 目錄中。只有 compile 範圍中的 Maven 相依關係會複製到伺服器中。 伺服器必須存在,且不能在執行中。 liberty:install-apps 目標可以結合 liberty:package-server 目標,來建立含有預先安裝之應用程式的 Liberty 伺服器保存檔。

參數

下表說明 install-apps 目標的參數。

表 1. install-apps 目標的參數.

第一個直欄包含一份參數清單,第二個直欄包含每個參數的說明,第三個直欄指出是否需要這個參數。

參數 說明 必要
serverHome Liberty 伺服器安裝架構的目錄位置。 是,只在未設定 assemblyArchiveassemblyArtifact 參數之時。
assemblyArchive Liberty 伺服器壓縮保存檔的位置。這個保存檔會解壓縮到 installDirectory 參數所指定的目錄中。 是,只在未設定 serverHomeassemblyArtifact 參數之時。
assemblyArtifact Liberty 伺服器組合的 Maven 構件名稱。組合會安裝到 installDirectory 參數所指定的目錄中。如需 Liberty 伺服器 Maven 組合的相關資訊,請參閱安裝為 Maven 構件 是,只在未設定 serverHomeassemblyArchive 參數之時。
installDirectory 當利用組合保存檔或構件選項來安裝 Liberty 伺服器時,該伺服器的本端安裝目錄位置。預設值為 ${project.build.directory} /liberty
refresh 如果是 true,則將 Liberty 伺服器重新安裝到本端目錄中。只有在利用組合保存檔或構件選項來安裝伺服器時,才使用這個參數。 預設值為 false
serverName Liberty 伺服器實例的名稱。預設值為 defaultServer
範例:安裝應用程式
這是可以在產品的 pom.xml 檔中使用的程式碼 Snippet。
<build>
    ...
    <dependencies>
        <!-- 要安裝及包裝的應用程式 -->
        <dependency>
            <groupId>wasdev</groupId>
            <artifactId>SimpleServlet</artifactId>
            	<version>1.0</version>
            <type>war</type>
        </dependency>
    </dependencies>
    ...
    <plugins>
        <plugin>
            	<groupId>com.ibm.websphere.wlp.maven.plugins</groupId>
            	<artifactId>liberty-maven-plugin</artifactId>
            	<version>1.0</version>
            	<executions>
                ...
                		<execution>
                    <id>install-apps</id>
                    				<phase>compile</phase>
                    			<goals>
                        <goal>install-apps</goal>
                    			</goals>
                		</execution>
                ...
            	<executions>
            <configuration>
                <serverHome>/opt/ibm/wlp</serverHome>
                			<serverName>test</serverName>
            </configuration>
        </plugin>
    </plugins>
    ...
</build>

指示主題類型的圖示 參照主題



「時間戳記」圖示 前次更新: 2016 年 11 月 30 日
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-libcore-mp&topic=rwlp_maven_installapps
檔名:rwlp_maven_installapps.html