Saffron, which is hideously expensive, seems to be eternal. Similarly most kinds of pepper, including allspice. Cloves, whole mace, whole nutmeg should all be good for years. Cinnamon seems to dry out and go brittle after a year or so, but can't do any harm in hot spiced wine. Fresh root ginger does dry out to the point where most of the flavour has gone, but ginger in syrup doesn't seem to go off at all - the stuff I have seems to go on and on. I have never known powdered/ground ginger lose any flavour at all. Caraway seeds seem to last an awful long time. Can't answer for aniseed or star anise.
But never keep any herbs or spices in any kind of plastic - they can sweat and rot.