maven antrun ssh or scp hides the output

霸气de小男生 提交于 2019-12-01 14:46:37

Give it a try with newer versions of JSCH dependencies (1.8.4 for ant-jsch and 0.1.53 for jsch, each with different group ids). It fixed the problem on my side:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-antrun-plugin</artifactId>
    <executions>
        <execution>
            <id>server-copy</id>
            <goals>
                <goal>run</goal>
            </goals>
            <phase>process-sources</phase>
            <configuration>
                <target>
                    <echo message="Pushing to host..." />
                    <sshexec host="hostname" username="user" trust="true" 
                        password="pass" failonerror="true"  
                        command="mkdir -p /home/user/test/test"/> 
                    <scp trust="yes"
                        file="some-file"
                        todir="user:pass@hostname:/path/to/some-file" 
                        />
                </target>
            </configuration>
        </execution>
    </executions>
    <dependencies>
        <dependency>
            <groupId>org.apache.ant</groupId>
            <artifactId>ant-jsch</artifactId>
            <version>1.8.4</version>
        </dependency>
        <dependency>
            <groupId>com.jcraft</groupId>
            <artifactId>jsch</artifactId>
            <version>0.1.53</version>
        </dependency>
    </dependencies>
</plugin>

Thank you very much. After two long evenings I found the solution.

I had the latest version of ant and not org.apache.ant which was changed at version 1.6 So latest version is today 1.10.1 and it works very well.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!