Gradle 雷克斯克当量,以格拉德尔为单位

Gradle 雷克斯克当量,以格拉德尔为单位,gradle,groovy,ant,rexec,Gradle,Groovy,Ant,Rexec,我正在做一个从Ant到Gradle的构建。在it中,它必须与IBM iSeries系统交互以打包文件,然后将其下载回进行构建的机器(Windows)。FTP部分很好,但我遇到的问题是rexec位 在Ant中,我们能够使用rexec任务,这非常有效。然而,我看不到格拉德尔方面的替代方案。这是我必须尝试并用Groovy编写的脚本吗?还是我缺少了其他选择?如果Gradle没有提供一些功能,通常会有一个插件。看看这个。它同时提供密码和证书身份验证。进一步研究表明,rexec不是SSH。它是一个独立的远程

我正在做一个从Ant到Gradle的构建。在it中,它必须与IBM iSeries系统交互以打包文件,然后将其下载回进行构建的机器(Windows)。FTP部分很好,但我遇到的问题是rexec位


在Ant中,我们能够使用rexec任务,这非常有效。然而,我看不到格拉德尔方面的替代方案。这是我必须尝试并用Groovy编写的脚本吗?还是我缺少了其他选择?

如果Gradle没有提供一些功能,通常会有一个插件。看看这个。它同时提供密码和证书身份验证。

进一步研究表明,
rexec
不是SSH。它是一个独立的远程协议,主要用于和iSeries交互

原来我要做的就是编写一个模仿REXEC功能的小程序。它利用了:

package com.myco.mypackage;

import java.beans.PropertyVetoException;
import java.io.IOException;
import com.ibm.as400.access.*;

public class RemoteCommandExecutor {

    private String system;
    private String user;
    private String password;
    private String command;

    public RemoteCommandExecutor(String system, String user, String password, String command) {
        this.system = system;
        this.user = user;
        this.password = password;
        this.command = command;
    }

    public void doCmd (){
        AS400 theSys = new AS400(this.getSystem(), this.getUser(), this.getPassword());
        CommandCall cmd = new CommandCall(theSys);
        try {
            cmd.run(this.getCommand());
             AS400Message[] messageList = cmd.getMessageList();
              for (int i = 0; i < messageList.length; i++) {
                 System.out.println(messageList[i].getText()); 
              }
        } catch (AS400SecurityException 
                | ErrorCompletingRequestException 
                | IOException 
                | InterruptedException
                | PropertyVetoException e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] args) {
        RemoteCommandExecutor exec = new RemoteCommandExecutor(args[0],args[1],args[2], args[3]);
        exec.doCmd();
    }

    /**
     * @return the system
     */
    public String getSystem() {
        return system;
    }

    /**
     * @param system the system to set
     */
    public void setSystem(String system) {
        this.system = system;
    }

    /**
     * @return the user
     */
    public String getUser() {
        return user;
    }

    /**
     * @param user the user to set
     */
    public void setUser(String user) {
        this.user = user;
    }

    /**
     * @return the password
     */
    public String getPassword() {
        return password;
    }

    /**
     * @param password the password to set
     */
    public void setPassword(String password) {
        this.password = password;
    }

    /**
     * @return the command
     */
    public String getCommand() {
        return command;
    }

    /**
     * @param command the command to set
     */
    public void setCommand(String command) {
        this.command = command;
    }

}
exec{
      commandLine "java", "-jar", "RemoteCommandExecutor.jar", project.ext.props.get("system"), project.ext.props.get("user"),project.ext.props.get("password"), project.ext.props.get("command.to.run")
    }