2

我正在尝试为 liferay 插件制作一份工作,并使其构建战争,然后通过Publish over SSH插件将其传输到远程 liferay 门户。

我的工作工作区位于 SDK portlets 目录中。问题是liferay SDK的构建脚本是在更高级别的工作空间外的一个目录上创建war,所以相对路径是../dist 目录结构是这样的

- SDK root
+ - ...
  - dist (the dir where the war is being created)
  - ...
  - portlets (the workspace of my job)
  - ...

因此,当我将相对路径 [../dist/portlet_name.war] 提供给 SSH 发布者的“源文件”字段时,它会找到 0 个要传输的文件:

SSH: Connecting SFTP channel ...
SSH: Connected
SSH: cd [/opt/liferay-portal]
SSH: OK
SSH: Disconnecting configuration [server_name [liferay]] ...
SSH: Transferred 0 file(s)

我也试图给出绝对路径,但没有成功。

有没有办法获取文件?提前致谢。

4

1 回答 1

2

为这个案例找到了这个,

最简单的解决方案可能是使用构建步骤将文件复制到您的工作区。

因此,您需要在传输文件之前添加“执行 Shell”步骤:

# current dir is your job's workspace
rm -fr your.file
cp ../../anotherJob/workspace/target/your.file
于 2013-08-21T06:52:53.513 回答