AC Milan have completed the signing of former academy striker Alessandro Matri from Juventus for an undisclosed fee.