If there’s a hiring manager at Google that wants someone to babysit products that shouldn’t die, but can’t attract career-oriented people to work on, ping me :)
The best way to keep going is to diversify, not only being a generalist, but also extending the soft skills, don't funnel too much in technology for technology's sake, and the career will be just fine, even with maintenance projects.
My org, which is more focused on maintenance than any other org at Google, has among the highest promotion rates. I personally lead a team whose primary job is related to code maintenance rather than product features. I've been promoted in the top 5% of promotion rates during my career.
It is true that there are maintenance teams that stagnate. It may be a different story for product managers or vps, but for engineers I've seen tremendous career success focused entirely on maintenance.
Wanna see your career die quickly? Move to a maintenance project.