When you say "make sure you are getting n years of experience and not one year of experience n times", do you mean to try and work on something different each year? Or did you mean something else?
Something different in that you aren’t working on slight variations of the same problems over and over again. You’re going deeper or wider or something that forces you to grow.
The failure mode of taking this advice is to constantly churn technologies and spend all your time learning superficialities about the new shiny.
It means continue to grow your experience either wider or deeper or both. You don't have do something completely different each year, but you should be thinking about how to expand your skillset. Unfortunately, this oftentimes means changing jobs, but not always.
An example of getting deeper if you're a Java programmer would be to really learn all the collections available (beyond ArrayList and HashMap) and when to use them. Wider would be to learn and improve on your SQL.
The failure mode of taking this advice is to constantly churn technologies and spend all your time learning superficialities about the new shiny.