Hoang Van-Tran, 40, pictured, pleaded guilty to producing drugs, abstracting electricity and possessing criminal property at Swindon Crown Court on 21 January.
The factory was discovered by Wiltshire Police officers at a property in Cambria Bridge Road.
Passing sentence, Recorder Michael Vere-Hodge QC said: “Cultivation is the start of the chain and if there weren’t people like you prepared to do this and put it on the market people would not have the available supply.
“If you didn’t cultivate it they would not have the supply, it is the supply that encourages them to start smoking it, or taking it in other ways, or to take more. It is that availability that is the evil that accompanies this.”
PC Paul Bezzant said: “This is a great result for our officers involved in this case. Convictions for a crime like this are not common, so securing one is a positive outcome.
“I echo what the judge says; if we can close down another drugs’ factory, then that is one less producer adding to the drugs’ supply chain and the misery it eventually causes.”