You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Mateusz Stefek (JIRA)" <ji...@codehaus.org> on 2008/05/09 15:48:27 UTC
[jira] Created: (MANTRUN-92) sshexec task inside maven-ant-run and
stdout problems
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
[jira] Commented: (MANTRUN-92) sshexec task inside maven-ant-run
and stdout problems
Posted by "Philip Graham (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MANTRUN-92?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=207650#action_207650 ]
Philip Graham commented on MANTRUN-92:
--------------------------------------
ant-jsch 1.7.1 is now in the central repository under groupId org.apache.ant rather than groupId ant.
<groupId>org.apache.ant</groupId>
<artifactId>ant-jsch</artifactId>
<version>1.7.1</version>
> 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
[jira] Commented: (MANTRUN-92) sshexec task inside maven-ant-run
and stdout problems
Posted by "Tim Fontaine (JIRA)" <ji...@codehaus.org>.
[ 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
[jira] Commented: (MANTRUN-92) sshexec task inside maven-ant-run
and stdout problems
Posted by "Stefan Franke (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MANTRUN-92?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=157560#action_157560 ]
Stefan Franke commented on MANTRUN-92:
--------------------------------------
Creating a patched version is futile. You will end up with patching any wierd behaving program.
Solution:
antrun must assign overlay streams before invoking ant. so ant and other tasks can do whatever with those overlays. On exit of antrun the original streams are restored.
And the overlay streams must not pass the close to the original streams.
voila.
> 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
[jira] Commented: (MANTRUN-92) sshexec task inside maven-ant-run
and stdout problems
Posted by "Alex Spurling (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MANTRUN-92?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=202676#action_202676 ]
Alex Spurling commented on MANTRUN-92:
--------------------------------------
This was fixed for my by changing the dependency on ant-jsch to 1.7.1. However, this jar is not yet on the main maven repositories so you will have to install/deploy the jar manually. The jar can be found in the latest distribution of ant: http://ant.apache.org/bindownload.cgi
> 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