Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ant The <copy> type doesn't support nested text data (" ") issue

Tags:

ant

Hi My ant build script snippest looks like this.

<copy todir="${warDir}/WEB-INF/classes">
    <fileset dir="${classdir}" includes="**/*.class" /> 
</copy>

I'm getting this error message when I execute ant against this build.xml

The <copy> type doesn't support nested text data (" ").

Can someone point out the issue I'm using fedora 16 and ant distribution 1.7.0

like image 936
Isuru Avatar asked Jun 16 '12 10:06

Isuru


3 Answers

I figure out the issue. I

copied the content and pasted in the vim editor

, there were some garbage character due to encoding which was invisible. If whole content is typed in vim editor without copying it works fine.

like image 137
Isuru Avatar answered Nov 03 '22 23:11

Isuru


It looks like this is due to the parser encountering a bad character. Inside the parenthesis at the end of the error, it tells you what the problem character is. I encountered the same problem, due to a bad copy-paste (a semicolon got introduced at the end of an element).

like image 20
Sean Glover Avatar answered Nov 03 '22 21:11

Sean Glover


Can't reproduce your problem. Perhaps this error is being reported against a different copy task within your build?

ANT normally throws this error message, when you've incorrectly specified your ANT task.

For example:

    <copy> todir="${warDir}/WEB-INF/classes"
        <fileset dir="${classdir}" includes="**/*.class" />
    </copy>

ANT doesn't like this because the "todir" parameter is now within the body of the tag, instead of being specified as an XML attribute.

like image 1
Mark O'Connor Avatar answered Nov 03 '22 22:11

Mark O'Connor