Maven pom.xml中的条件sshexec

我在pom.xml文件中使用maven-antrun-plugin将构建jar部署到特定文件夹下的远程服务器中。 该文件夹可能存在或不存在。如果不存在,则需要在部署之前创建它。 我使用以下sshexec来做到这一点:

<sshexec
   host="${remote_host}"
   username="${remote_user}"
   password="${remote_password}"
   command="mkdir ${MY_PATH}"
   trust="true" 
/>

问题是,如果文件夹存在,则sshexec任务将失败: A subdirectory or file MY_PATH already exists.

该失败终止了执行,并且未完成目标。 我需要的是一种用条件检查此sshexec的方法,该条件检查所需的文件夹是否存在。 我怎样才能做到这一点?

guoguo337 回答:Maven pom.xml中的条件sshexec

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3136999.html

大家都在问