This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using exec task

 
Minu Jain
Ranch Hand
Posts: 74
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I am trying to run a script using the source command through the following build.xml:

<project name="Sample" default="test">
<target name="test">
<exec executable="source">
<arg line="/opt/bea/wlserver_10.3/server/bin/setWLSEnv.sh"/>
</exec>
</target>
</project>


I get the following error on running this:
Buildfile: build.xml

test:

BUILD FAILED
/home/ser/minu/test/build.xml:3: Execute failed: java.io.IOException: Cannot run program "source": java.io.IOException: error=2, No such file or directory

Total time: 0 seconds



Could anyone tell me what could be the problem?

Thanks in advance!
 
Minu Jain
Ranch Hand
Posts: 74
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, if instead I run the above script by directly typing the command on the prompt like this

source /opt/bea/wlserver_10.3/common/bin/commEnv.sh

it works fine.
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The "executable" property of <exec> must be a an executable file. "source' is not an executable file, rather it is a command built into the shell. Besides, I doubt that sourcing a shell within an Ant script will get you what you want - the environment set by setWLSEnv.sh will not be retained for any subsequent shells that you invoke.
 
Minu Jain
Ranch Hand
Posts: 74
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic