Bayern Munich pipped Borussia Dortmund to the BL title on goal difference on the final day of the season.