[英]Error invoking command! when deploying war to WebSphere Liberty server using Maven Cargo
I'm currently trying to deploy a war file to a Websphere Liberty server. 我当前正在尝试将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>
When I run 当我跑步
cargo:deploy -Pintegration
货物:部署-整合
I get the following error 我收到以下错误
[ERROR] Failed to execute goal org.codehaus.cargo:cargo-maven2->plugin:1.6.11:deploy (default-cli) on project artifact: Execution >default-cli of goal org.codehaus.cargo:cargo-maven2-plugin:1.6.11:deploy >failed: Deploy failed: Cannot execute jython script.
[错误]无法在项目工件上执行目标org.codehaus.cargo:cargo-maven2->插件:1.6.11:deploy(默认-cli):执行>目标org.codehaus.cargo:cargo-maven2的默认-cli -plugin:1.6.11:deploy>失败:部署失败:无法执行jython脚本。 Error invoking command!
调用命令时出错! >Cannot run program "null\\bin\\wsadmin.bat": CreateProcess error=2, The system >cannot find the file specified
>无法运行程序“ null \\ bin \\ wsadmin.bat”:CreateProcess错误= 2,系统>找不到指定的文件
Anyone know what is causing this? 有人知道是什么原因造成的吗?
What plugin\\dependency I should use to get wsadmin.bat? 我应该使用什么插件\\依赖来获取wsadmin.bat?
Or how I can fix this problem? 或者如何解决此问题?
Thanks in advance 提前致谢
UPDATE UPDATE
I am almost able to get this working The new config is below 我几乎可以使它工作新的配置如下
<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>
The issue now is that the war file is getting deployed to 现在的问题是战争文件正在部署到
LibertyServer\\servers\\defaultServer\\apps
LibertyServer \\服务器\\ defaultServer \\ APPS
While the correct location should be 虽然正确的位置应该是
LibertyServer\\usr\\servers\\defaultServer\\apps
LibertyServer的\\ usr \\服务器\\ defaultServer \\ APPS
I have been looking at the reference guide but I don't see a way to have a custom directory. 我一直在看参考指南,但没有找到自定义目录的方法。
I did try to add 我确实尝试添加
<files>
<copy>
<file>war file</file>
<toDir>LibertyServer\usr\servers\defaultServer\apps</toDir>
<overwrite>true</overwrite>
</copy>
</files>
Into the configuration settings. 进入配置设置。
But as expected this did not work. 但是按预期,这没有用。
Any ideas? 有任何想法吗?
Thanks again. 再次感谢。
Update <home>WebSphere server location</home>
to point to your WAS_HOME location. 更新
<home>WebSphere server location</home>
以指向您的WAS_HOME位置。 When it tries to locate wsadmin to execute the jython script, it's failing: null\\bin\\wsadmin.bat. 当它试图找到wsadmin来执行jython脚本时,它失败了:null \\ bin \\ wsadmin.bat。 null should be the value of WAS_HOME...
null应该是WAS_HOME的值...
Got the deployment working with the following code 使用以下代码进行了部署
<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>
Also it seems that you cannot configure where the war file is deployed to. 同样,您似乎无法配置war文件的部署位置。 It will only deploy to defaultServer.
它将仅部署到defaultServer。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.