After talking with another Maven Ant task user (Dave Brondsema), we've determined that Ant's FileList getFiles() method throws an exception instead of an empty String array when no files are specified. For testing purposes, I made the following changes to DependenciesTask.java to avoid this exception. I didn't create a patch because this code isn't the cleanest.
FileList fileList = new FileList();
boolean fileListElementsAdded = false;
...
for ( Iterator i = result.getArtifacts().iterator(); i.hasNext(); )
{
fileList.addConfiguredFile( file );
fileListElementsAdded = true;
}
...
if ( pathId != null )
{
Path path = new Path( getProject() );
if (fileListElementsAdded) {
path.addFilelist( fileList );
}
getProject().addReference( pathId, path );
}
If a project does not have any dependencies, the resulting path will cause a "No files specified for filelist" error when trying to reference it. Here is a related user list thread: http://www.mail-archive.com/users@maven.apache.org/msg25990.html. Although Brett requested a bug submission, I did not yet see one in JIRA.