Fix incorrect classpath resolution of artifacts.

Artifacts which have an artifact id contained in the id of anotherartifact (i.e. 'eventservice' and 'gwteventservice') may be incorrectly resolved.