Java Mailing List Archive

http://www.ant-tasks.com/

Home » Ant Users List »

Re: Exec task: Args not passed to task

Peter Reilly

2008-04-29

Replies: Find Java Web Hosting

Author LoginPost Reply
can you make a selfcontained build.xml that shows the
problem, this will help in tracking down the problem.

Also, can you open a bugzilla issue for the problem, this
will help in tracking the issue.

Peter

On Tue, Apr 29, 2008 at 7:46 AM, Xavi <ettikx@(protected):
> Hi,
>
> I tried it too. It doesn't work -nested args are ignored- :(
> I forgot to say that I'm running ant in java 1.5.
>
> I changed ant's libs (I used again ant 1.6) and args work (arg line arg
> value, it doesn't matter). But I need to use ant 1.7 :/
>
>
> 2008/4/28, David Weintraub <qazwart@(protected)>:
>
>
> >
> > What if you used the <arg value="xx"/> instead of <arg line="xx xx xx"/>?
> >
> > That is:
> >
> > <exec executable="chmod"
> >   timeout="${timeout}"
> >   failonerror="true">
> >  <arg value="-R"
> >  <arg value="${dirMask}"
> >   <arg value="${path}"/>
> > </exec>
> >
> > On Mon, Apr 28, 2008 at 3:20 AM, Xavi <ettikx@(protected):
> > > Hi, I'm migrating an app from Ant 1.6.1 to Ant 1.7.0, and I have
> > problems
> > > with exec tasks. Ant execute task without passing arguments to process!
> > >
> > > For example, I have this task definition:
> > >
> > > <project name="permision" default="permision" basedir=".">
> > >
> > >      <property name="timeout" value="120000" />
> > >
> > >      <target name="permision">
> > >
> > >           <echo message="Modify directories permissions ${path},
> > mask
> > > ${dirMask}" />
> > >
> > >           <exec executable="chmod"
> > >                  timeout="${timeout}"
> > >                  failonerror="true">
> > >
> > >                 <arg line="-R ${dirMask} ${path}" />
> > >
> > >           </exec>
> > >
> > >           <echo message="Modify files permissions ${path}, mask
> > > ${fileMask}" />
> > >
> > >           <exec executable="/data/bin/ant/permisions.sh"
> > >                  timeout="${timeout}"
> > >                  failonerror="true">
> > >
> > >                 <arg line="${path} ${fileMask}" />
> > >
> > >           </exec>
> > >
> > >      </target>
> > >
> > > </project>
> > >
> > > An easy one, and works ok with Ant 1.6, as you can see in logs:
> > >
> > > (...)
> > > 23 Apr 2008 17:31:10 [INFO ] Modify directories permissions
> > > /data/servers/ftp, mask 755
> > > 23 Apr 2008 17:31:10 [DEBUG] Task "echo"finished
> > > 23 Apr 2008 17:31:10 [DEBUG] Task "exec" started
> > > 23 Apr 2008 17:31:10 [DEBUG] Current OS is AIX
> > > 23 Apr 2008 17:31:10 [DEBUG] Executing 'chmod' with arguments:
> > > '-R'
> > > '755'
> > > '/data/servers/ftp'
> > >
> > > The ' characters around the executable and arguments are
> > > not part of the command.
> > > 23 Apr 2008 17:31:10 [DEBUG] Execute:Java13CommandLauncher: Executing
> > > 'chmod' with arguments:
> > > '-R'
> > > '755'
> > > '/data/servers/ftp
> > >
> > > The ' characters around the executable and arguments are
> > > not part of the command.
> > > 23 Apr 2008 17:31:10 [INFO ]
> > > (...)
> > >
> > >
> > > With Ant 1.7.0 I get this log:
> > >
> > > 24 Apr 2008 15:49:42 [DEBUG] Task "echo" started
> > > 24 Apr 2008 15:49:42 [INFO ] Modify directories permissions
> > > /data/servers/ftp, mask 777
> > > 24 Apr 2008 15:49:42 [DEBUG] Task "echo"finished
> > > 24 Apr 2008 15:49:42 [DEBUG] Task "exec" started
> > > 24 Apr 2008 15:49:42 [DEBUG] Current OS is AIX
> > > 24 Apr 2008 15:49:42 [DEBUG] Executing 'chmod'
> > > The ' characters around the executable and arguments are
> > > not part of the command.
> > > 24 Apr 2008 15:49:42 [DEBUG] Execute:Java13CommandLauncher: Executing
> > > 'chmod'
> > > The ' characters around the executable and arguments are
> > > not part of the command.
> > > 24 Apr 2008 15:49:42 [INFO ] Usage: chmod [-R] [-f] [-h] {u|g|o|a ...}
> > > {+|-|=} {r|w|x|X|s|t ...} File ...
> > > 24 Apr 2008 15:49:42 [INFO ] chmod [-R] [-f] [-h] OctalNumber File ...
> > > 24 Apr 2008 15:49:42 [INFO ] Changes the permission codes for files or
> > > directories.
> > > 24 Apr 2008 15:49:42 [ERROR] Task "exec" finished with error (null)
> > > 24 Apr 2008 15:49:42 [ERROR] Target "permision" finished with error
> > (null)
> > > /data/bin/ant/permisions.xml:8: exec returned: 255
> > >   at
> > org.apache.tools.ant.taskdefs.ExecTask.runExecute (ExecTask.java:636)
> > >   at org.apache.tools.ant.taskdefs.ExecTask.runExec (ExecTask.java:662)
> > >   at org.apache.tools.ant.taskdefs.ExecTask.execute (ExecTask.java:487)
> > >   at sun.reflect.GeneratedMethodAccessor16.invoke(Unknown Source)
> > >   at
> >
> > > sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
> > >   at java.lang.reflect.Method.invoke (Method.java:618)
> > >   at
> >
> > > org.apache.tools.ant.dispatch.DispatchUtils.execute (DispatchUtils.java:105)
> > >   at org.apache.tools.ant.Task.perform (Task.java:348)
> > >   at org.apache.tools.ant.Target.execute (Target.java:357)
> > >   at org.apache.tools.ant.Target.performTasks (Target.java:385)
> > >   at
> > org.apache.tools.ant.Project.executeSortedTargets (Project.java:1329)
> > >   at org.apache.tools.ant.Project.executeTarget (Project.java:1298)
> > >   at
> >
> > > org.apache.tools.ant.helper.DefaultExecutor.executeTargets (DefaultExecutor.java:41)
> > >   at org.apache.tools.ant.Project.executeTargets (Project.java:1181)
> > >   at com.sbd.hardist.util.ant.AntProcess.execute(AntProcess.java:157)
> > >
> > > Ant task isn't receiving parameters!
> > >
> > > This task are executed using Ant's java api. If I execute task
> > manually, all
> > > goes ok too. And if I use deprecated <exec command, all goes fine too!
> > >
> > > Someone have an idea what's happening here? Thanks in advance!
> > >
> >
> >
> >
> > --
> > --
> > David Weintraub
> > qazwart@(protected)
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > For additional commands, e-mail: user-help@(protected)
> >
> >
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 ant-tasks.com - Jax Systems, LLC, U.S.A.