2 (he did this only to teach warfare to the descendants of the Israelites who had not had previous battle experience):

Read Judges 3:2 Using Other Translations

Only that the generations of the children of Israel might know, to teach them war, at the least such as before knew nothing thereof;
It was only in order that the generations of the people of Israel might know war, to teach war to those who had not known it before.
He did this to teach warfare to generations of Israelites who had no experience in battle.