We present measurements of the mean mid-infrared to submillimetre flux densities of massive (M★≳ 1011 M⊙) galaxies at redshifts 1.7 < z < 2.9, obtained by stacking positions of known objects taken from the GOODS NICMOS Survey (GNS) catalogue on maps at 24 m (Spitzer/MIPS); 70, 100 and 160 m (Herschel/PACS); 250, 350 and 500 m (BLAST); and 870 m (LABOCA). A modified blackbody spectrum fit to the stacked flux densities indicates a median [interquartile] star formation rate (SFR) of SFR = 63[48, 81] M⊙ yr−1. We note that not properly accounting for correlations between bands when fitting stacked data can significantly bias the result. The galaxies are divided into two groups, disc-like and spheroid-like, according to their Sérsic indices, n. We find evidence that most of the star formation is occurring in n≤ 2 (disc-like) galaxies, with median [interquartile] SFR = 122[100, 150] M⊙ yr−1, while there are indications that the n > 2 (spheroid-like) population may be forming stars at a median [interquartile] SFR = 14[9, 20] M⊙ yr−1, if at all. Finally, we show that star formation is a plausible mechanism for size evolution in this population as a whole, but find only marginal evidence that it is what drives the expansion of the spheroid-like galaxies.