Dodi Suridi, 23, was captured a day after the January 14 attack that killed eight people including four militants, who police said claimed allegiance to the Islamic State group.
Judge Achmad Fauzi, who presided over the trial at the West Jakarta District Court, said Suridi was guilty of violating Indonesia's anti-terror law by preparing bombs used in the attack.
About 40 militants have been arrested in connection with the attack that began with a suicide bombing inside a Starbucks cafe.
Prosecutors had demanded a 10-year sentence.
Also Read
IS' deadly attacks in the Middle East and Europe and the group's online propaganda have helped to recruit a tiny minority of Indonesians to their cause. Authorities say several hundred Indonesians also have travelled to Syria to fight with IS.
But experts say their capacity to mount successful attacks within Indonesia is still limited.
Recent plots have failed completely, including a would-be bombing of a church in Medan on Sumatra and an attack on a police complex in Solo on Java that killed only the suicide bomber.
Disclaimer: No Business Standard Journalist was involved in creation of this content