The clubs last met 32 years ago in a friendly in the same city with Anfield legend Ian Rush scoring the visitors' goal in a 1-1 draw.
Shamrock Rovers chairman Jonathan Roche said: "We are delighted to be taking on Liverpool in this high-profile game at Aviva Stadium.
"It will see two clubs with strong histories of success and great fans face each other in what should be an entertaining game of football and a great occasion.
"It will be a great game for our players to be involved in, and also a good day out for our fans and Irish supporters of Liverpool, many of whom are also SSE Airtricity League supporters."
Billy Hogan, Liverpool's chief commercial officer, said: "We are looking forward to coming back to Dublin again this year to play in front of our Irish fans.
"The club enjoys incredible support in Ireland. Shamrock Rovers hold a special place for us as we bought Jim Beglin from them in 1983, who became Bob Paisley's last-ever signing."
Reflecting on the previous meeting of the sides, Rush, who is now an ambassador for the Premier League side, said: "I played in the game against Shamrock Rovers over three decades ago and I remember scoring that goal.
"It will be great to play them again and take away a win this time rather than a draw."