I've began to work on this, but have no time for the moment to add unit test. However it's quite simple and have good chances to work. If someone want to test it, you can use the new type attribute on the resolve task, it accepts a comma separated list of accepted types.
For those calling ivy from java, the resolve method may now be called with filter which will be queried before artifact downloading.
There is also a new download method on Ivy which can be used to download artifact individually.
Finally, a static method on DefaultArtifact let one clone an artifact with a new type. So getting the source artifact for a jar artifact can be done like this :
Ivy ivy = ...
Artifact jar = ...
Artifact source = DefaultArtifact.cloneWithAnotherType(jar);
ArtifactDownloadReport report = ivy.download(source, null);
if (report.getDownloadStatus() != DownloadStatus.FAILED)
File sourceFile = ivy.getArchiveFileInCache(source);