I've never done if but there is one person over on JF that did one into his TJ. No swap is SIMPLE no matter which route you decide to try and go. Of course the wiring would be one of the harder issues. And then with the know problems with the 4.7 I'm not sure it would be my first choice for engine swap. There are enough threads on here and other forums about either using the 5.2/5.9 Magnum V-8's or the 5.7 Hemi that if you want to do a swap I would lean towards one of those first. Then your next option is to use a GM LS engine in the 5.3/6.0/6.2 versions.
They will all pose issues and won't be simple.