Here is an example of how to use a classifier with maven ant run tasks:
<target name="install-jar">
...
<artifact:pom id="sharedPom" file="shared/pom.xml" />
<artifact:install file="${classesdir}/shared.jar" >
<pom refid="sharedPom" />
<attach file="${builddir}/shared-sources.jar" classifier="sources" />
</artifact:install>
</target>
The attach referenced to in the documentation is meant to be a sub-element. Hope this helps.