You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Tim Fontaine (JIRA)" <ji...@codehaus.org> on 2008/06/24 09:38:26 UTC

[jira] Commented: (MANTRUN-92) sshexec task inside maven-ant-run and stdout problems

    [ http://jira.codehaus.org/browse/MANTRUN-92?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=139394#action_139394 ] 

Tim Fontaine commented on MANTRUN-92:
-------------------------------------

I have traced the bug to Ant. 

Jsch does a close of the in and outputstream by default.
As the system.out is given as outputstream, of course nothing is written anymore to the console.
In the class Channel in the setters is a parameter to don't close the stream. This has to be called instead of the setter without extra parameters.

In SSHExec :
  out = System.out
147: channel.setOutputStream(out);   
148: channel.setExtOutputStream(out);
this has to be
147: channel.setOutputStream(out, true); 
148: channel.setExtOutputStream(out, true);

As I don't know how to fix Ant bugs and I don't have time at my work to find that out, another  developper will have to make a patch

We work now with a custom build of ant-jsch

> sshexec task inside maven-ant-run and stdout problems
> -----------------------------------------------------
>
>                 Key: MANTRUN-92
>                 URL: http://jira.codehaus.org/browse/MANTRUN-92
>             Project: Maven 2.x Antrun Plugin
>          Issue Type: Bug
>    Affects Versions: 1.1
>         Environment: Issue seen on Windows and Linux
>            Reporter: Mateusz Stefek
>         Attachments: myapp.tgz
>
>
> When the sshexec ant task is executed by the maven-ant-run plugin:
> <plugin>
>   <groupId>org.apache.maven.plugins</groupId>
>   <artifactId>maven-antrun-plugin</artifactId>
>   <version>1.1</version>
>   <executions>
>     <execution>
>       <id>server-copy</id>
>         <goals>
>           <goal>run</goal>
>         </goals>
>         <phase>package</phase>
>         <configuration>
>                             <tasks>
>                                 <echo message="Step 1"/>
>                                 <sshexec host="yourhost" username="yourname" password="yourpassword" command="echo Hello World" trust="true" />
>                                 <echo message="Step 2"/>
>                                 <mkdir dir="c:\xyz"/>
>                             </tasks>
>       </configuration>
>       </execution>
>   </executions>
>   <dependencies>
>       <dependency>
>         <groupId>ant</groupId>
>         <artifactId>ant-jsch</artifactId>
>         <version>1.6.2</version>
>   </dependency>
>  </plugin>
> maven process doesn't output anything after "Hello World". However, the build continues fine after that. Only the output console seems to be closed by sshexec.
> A simple example project attached.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira