changing from a 4cyl to a 6cyl although it isnt impossible, requires a multitude of changes.
Your YJ will need:
New frame towers, old ones cut out and new ones welded in.
New bell housing.
New trans and t-case.
New drive shafts.
New wiring harness, including the tach in the dash, 4 to 6cyl arent compatible.
Basically, its easier to swap in a small block chevy or ford motor, and use their trans and t-case. Then you will just need to get custom made drive shafts. But you will still have a nightmare with wiring, and emissions if required in your area.
And like 4jeepn said, the rear is a Dana35, and it wont handle the torque from a V8, so it will need replaced as well.
IMO, keep the 2.5L and put your money into the jeep in other ways, it wont be a powerhouse, but it will still be fun to play with.