You can rely on one or two traps if they're really, REALLY good ones like Project Fuck the World. Otherwise, you have a few choices other than military might
1) Giant trap swarm: a cluster of around 100 (a 10x10 square) Cage and/or 10x Serrated Disk weapon traps that must be passed over to access your fortress. Each trap will eliminate an invader, either by trapping it or reducing it to chunky salsa, and then (probably -- the disks only *might* jam) be rendered ineffective. In practice, the Disks are better as the losses will make survivors run, but are VASTLY more expensive and time consuming to set up.
2) Unavoidable Deadly Trap: Wall up or use pressure plates in such a way that invaders are forced to pass by/fed to a captive forgotten beast or otherwise isolated from anything they could possibly hurt. Basically, the "one good trap". Drowning chambers and magma chambers are awesome for this. Bridges used to be this, but they've been nerfed and atomsmashing as a defense is a step cheaper even than cage traps, IMO
3) Pathing Cheap-shot: Force goblins to path back and forth across a long hall of repeating upright spikes, or something like that. Distinct from the above in that it's not abjectly lethal, but abuses invader logic to become lethal. Unless your Unavoidable Deadly Trap involved magma, this is probably dorfier.
4) Time: Be able to seal the gates and wait the siege out. It can take over a year if they chain sieges, but they WILL give up and let you out after a while. Consider this the last resort if your other defenses have failed to neutralize the siege, but never don't have this as an option