Colm O'Lochlainn, in More Irish Street Ballads (from where most people will have learned it) mentions a ballad sheet origin, no date given. He also mentions that O'Neill's Irish Minstrels "gives a long story and some verses". I don't have a copy - so can't check details.
Regards