When I did the search for 'Jesus the Apple Tree', Joshua Smith was one of the other names mentioned.

"The first known publication of 'Jesus Christ the Apple Tree' was in 1784 in Divine Hymns, or Spiritual Songs: for the use of Religious Assemblies and Private Christians compiled by Joshua Smith, a lay Baptist minister from New Hampshire. The hymn may have been based on an earlier anonymous poem first printed in London's Spiritual Magazine in August 1761 crediting 'R.H.' as the writer."

It's quite possile this is an old Scottish melody that has remained unattributed for a couple of centuries. There are several tunes like this in the pipe band world and the Scottish fiddle tradition, when the tune has been published and re-published as 'trad' or 'anon' so many times the original composer has been forgotten.