The ant tasks currently use the standard maven artifact scope filtering. This means that setting "useScope" to "compile" actually includes the scopes "compile", "runtime", and "system". This is not intuitive to a typical ant user.
A better behaviour is for the the useScope attribute to allow a comma separated list of specific scopes to include. So for example, setting useScope to "compile, provided" would only include artifacts that have one of these two scopes set.