Mine are all glued in with thickened (with colloidal silica) West epoxy, simply because I had it to hand. It does soften at around 100 deg C or so, so isn't the best choice if you anticipate that your motor is going to get really hot. In my applications the motors stay cool, so it isn't a problem.
There are higher temperature epoxy resins available, plus all epoxies can have the temperature at which they soften increased a fair bit if they are heated during the final curing stage (i.e. once the resin has cured to a semi-solid state). Baking resins at around 100 deg C or so for the final cure will raise the transition temperature, at which the stuff starts to soften. My only worry with doing this on a hub would be ensuring that all the other parts in the hub are OK at high temperatures.
Jeremy