Use danger rooms!
#D###
#sss###
#sssdA#
#sss###
#####
D - normal door, d - locked internal door, A - armor stand, s - training spear trap, # - wall.
Dig a 3x3 room. Construct 9 wooden training spears, the more (x2, x3)- the better. Build 9 upright spear traps on every tile from the spears. Build a lever in the middle of dining room, link it to all the traps. Dig a two tile tunnel in a wall of the room, build an armor stand (to attract military) and a door, the armor stand shall be behind the door. Mark the door as internal. Order it to be locked. Build a door at room entrance. Designate barracks from the armor stand, the outer door will stop the area from spreading out.
Now make sure your military has all the equipment on to avoid injury. Welcome your dwarves to the room. (In barracks area properties mark that this room is OK for training of your squad. Set your squad to active/training alert.) Ideally there shall be less than 9 dwarves in a room to leave some space for dodging. Like 5 of them.
Ask your dwarves in dining room to pull the lever and mark the task to be repeated with 'r' key. Now folks in dining room are pulling the lever there and back. The spears are hitting the dwarves again and again, and this provides an AWESOME practice.