maven/ant and ssh/exec - missing or ill-formed stdout

P

pjh1

Hi!

I've got a slight problem with maven/ant using ssh to execute a script
on a remote unix host.

The command is fired off ok but the stdout from the command is ill
formed and missing.
I have created a simple maven plugin to demonstrate my problem:

when I run

maven phil:test -Dcmd="echo -n hello;echo -n ' 'there; echo '
'you"
All the output is typically one line (as expected):

but if I run
maven phil:test -Dcmd="echo -n hello;sleep 1;echo -n ' 'there;
echo ' 'you"
All the output from 'there' onwards is on a second line.

Also, I keep getting spurious characters (normally a suit from a set of
cards!) on new lines of output.

Saying that, it has now all started being displayed on separate lines
with or without the sleep statement - and I'm getting a whole selection
of playing card suit characters!

If I run the commands on the remote host (without ssh) it works fine.


Can anyone shed any light on this?

Thanks

Philip

plugin.jelly:
<?xml version="1.0"?>

<project
xmlns:j="jelly:core"
xmlns:u="jelly:util"
xmlns:ant="jelly:ant"
xmlns:define="jelly:define"
xmlns:my_taglib="my_taglib"

<define:taglib uri="my_taglib">
<define:tag name="rem_cmd">
<taskdef name="ssh" classname="com.sshtools.ant.Ssh"
classpathref="maven.dependency.classpath"/>
<ant:ssh host="${deploy_server}"
username="${deploy_username}" password="${deploy_password}">
<ant:exec cmd="${cmd}" />
</ant:ssh>
</define:tag>
</define:taglib>
<goal name="phil:test">
<my_taglib:rem_cmd
deploy_server="${dev.ftpserver}"
deploy_username="${dev.ftpusername}"
deploy_password="${dev.ftppassword}" />
</goal>
</project>

project.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project>
<pomVersion>3</pomVersion>

<name>Phil's test Plugin</name>
<shortDescription>Test plugin</shortDescription>
<url></url>
<issueTrackingUrl></issueTrackingUrl>

<siteDirectory></siteDirectory>

<groupId>phil-test-maven</groupId>
<id>phil-test-plugin</id>
<currentVersion>0.1</currentVersion>

<repository>
<connection></connection>
<developerConnection></developerConnection>
<url></url>
</repository>

<versions>
</versions>

<developers>
<developer>
<name>Philip Harris</name>
<id></id>
<email>a@b</email>
<organization>HaHa</organization>
<roles>
<role>Developer</role>
</roles>
</developer>
</developers>

<dependencies>
<dependency>
<groupId>maverick-ant</groupId>
<artifactId>maverick-ant</artifactId>
<version>1.0</version>
<properties>
<classloader>root</classloader>
</properties>
</dependency>
</dependencies>

<build>
<resources>
<resource>
<directory>${basedir}</directory>
<includes>
<include>plugin.jelly</include>
<include>plugin.properties</include>
<include>project.properties</include>
<include>project.xml</include>
</includes>
</resource>
</resources>
</build>
</project>

project.properties: This is effectively empty

plugin.properties:
dev.ftpserver = <host>
dev.ftpusername = <username>
dev.ftppassword = <password>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top