No trick. If it doesn't stick, it's because it's not hot enough, or oxidized/blued, or not enough flux. Keep the metal clean, keep it fluxed, keep if from turning color, and keep touching your solder to it, and when it gets hot enough, the solder will melt and stick right to it. Avoid letting your torch blow around the barrel, as that will melt the solder, often even before it touches the barrel. That's what makes it roll off.
There is a solder-stop material that you can paint on around the area that you don't want solder to stick, though I've never used it, though it would be a good idea. I've just always cleaned/filed/sanded off the excess.