I want to know how to use the special characters (like < ) in an ant build file.
I'm trying to create a target in my ant file to execute a script in mysql. Since mysql has no options for input file, on the command prompt, it can be done using the < filename.sql option. However, putting the < character in the arg section of exec task in an ant file gives errors.
Any help would be really appreciated. Thanks! Neha.
First, an Ant build.xml file is (suprise!) an XML file. The < > " & and ' characters cannot be used directly, since they all have meaning as XML lexical elements, so instead you either have to use a CDATA or an entity (< > " & and &apos .
But that's not enough. The '<' character has no special meaning to Ant as regards I/O piping and redirection - that functionality is provided by the user's command shell. SO what you really need isn't a way to code a redirection, but rather a specific redirection directive.
An IDE is no substitute for an Intelligent Developer.