Inevitably most developers may find themselves on a dead-end project. Sooner or later this will happen. Whether it is a perfectly fine project that has outlived its usefulness and is on its way out, or a mismanaged one -- it doesn't matter. One day you may find the project you've grown to enjoy is getting canceled or replaced. You've worked on it for so long that you find yourself thinking -- if I just add this one more feature, or fix this one more bug, maybe the management will see just how great my work is and everything will go back to the way it used to be.
It won't.
If you consider yourself a talented developer with marketable skills and you find yourself in this situation -- start considering your options. You won't learn anything new from staying on a dead end maintenance project and your career will not benefit from the experience. The moment your management says your project is no longer aligned with the long term strategic interests of your organization, run. Call your recruiters, beef up your resume, look around for an internal transfer.
Do not simply wait, because this stage of your project may last for years. Let go and move on.