The song circulated widely before the published version. I heard on a podcast that the earliest version of what came to be the official song came from an army unit. They had a member, who was absent, when John Brown was hanged. That soldier was also named John Brown and the men joked that it was their comrade who was killed.
John Brown's body lies a moldering in the grave
John Brown's body lies a moldering in the grave
John Brown's body lies a moldering in the grave
But his truth keeps marching on.
It caught on during the War and had innumerable different lyrics. My personal favorite: