簡體   English   中英

調用命令時出錯! 使用Maven Cargo將戰爭部署到WebSphere Liberty服務器時

[英]Error invoking command! when deploying war to WebSphere Liberty server using Maven Cargo

我當前正在嘗試將War文件部署到Websphere Liberty服務器。

    <profile>
        <id>integration</id>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.codehaus.cargo</groupId>
                    <artifactId>cargo-maven2-plugin</artifactId>
                    <version>1.6.11</version>
                    <configuration>
                        <!-- Container configuration -->
                        <container>
                            <containerId>websphere85x</containerId>
                            <type>installed</type>
                        </container>
                        <configuration>
                            <type>existing</type>
                            <home>WebSphere server location</home>
                        </configuration>
                        <deployables>
                            <deployable>
                                <artifactId>artifact</artifactId>
                                <groupId>com.group</groupId>
                                <type>war</type>
                            </deployable>
                        </deployables>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    </profile>

當我跑步

貨物:部署-整合

我收到以下錯誤

[錯誤]無法在項目工件上執行目標org.codehaus.cargo:cargo-maven2->插件:1.6.11:deploy(默認-cli):執行>目標org.codehaus.cargo:cargo-maven2的默認-cli -plugin:1.6.11:deploy>失敗:部署失敗:無法執行jython腳本。 調用命令時出錯! >無法運行程序“ null \\ bin \\ wsadmin.bat”:CreateProcess錯誤= 2,系統>找不到指定的文件

有人知道是什么原因造成的嗎?

我應該使用什么插件\\依賴來獲取wsadmin.bat?

或者如何解決此問題?

提前致謝

UPDATE

我幾乎可以使它工作新的配置如下

<profile>
    <id>integration</id>
    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.cargo</groupId>
                <artifactId>cargo-maven2-plugin</artifactId>
                <version>1.6.11</version>
                <configuration>
                    <!-- Container configuration -->
                    <container>
                        <containerId>liberty</containerId>
                        <type>installed</type>
                    </container>
                    <configuration>
                        <home>LibertyServer</home>
                    </configuration>
                    <deployables>
                        <deployable>
                            <artifactId>SIS-AM-CONSOL-GSPWeb</artifactId>
                            <groupId>com.group</groupId>
                            <type>war</type>
                        </deployable>
                    </deployables>
                </configuration>
            </plugin>
        </plugins>
    </build>
</profile>

現在的問題是戰爭文件正在部署到

LibertyServer \\服務器\\ defaultServer \\ APPS

雖然正確的位置應該是

LibertyServer的\\ usr \\服務器\\ defaultServer \\ APPS

我一直在看參考指南,但沒有找到自定義目錄的方法。

我確實嘗試添加

<files>
    <copy>
        <file>war file</file>
        <toDir>LibertyServer\usr\servers\defaultServer\apps</toDir>
        <overwrite>true</overwrite>
    </copy>
</files>

進入配置設置。

但是按預期,這沒有用。

有任何想法嗎?

再次感謝。

更新<home>WebSphere server location</home>以指向您的WAS_HOME位置。 當它試圖找到wsadmin來執行jython腳本時,它失敗了:null \\ bin \\ wsadmin.bat。 null應該是WAS_HOME的值...

使用以下代碼進行了部署

<profile>
    <id>integration</id>
    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.cargo</groupId>
                <artifactId>cargo-maven2-plugin</artifactId>
                <version>1.6.11</version>
                <configuration>
                    <!-- Container configuration -->
                    <container>
                        <timeout>600000</timeout>
                        <containerId>liberty</containerId>
                        <type>installed</type>
                        <home>ServerHome</home>
                    </container>
                    <configuration>
                        <type>standalone</type>
                        <home>ServerHome</home>
                    </configuration>
                    <deployables>
                        <deployable>
                            <artifactId>Artifact</artifactId>
                            <groupId>com.group</groupId>
                            <type>war</type>
                        </deployable>
                    </deployables>
                </configuration>
            </plugin>
        </plugins>
    </build>
</profile>

同樣,您似乎無法配置war文件的部署位置。 它將僅部署到defaultServer。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM