You could always switch to a java technology, such as jakarta ee or the spring framework. Or C sharp with .net core.
Or use the various work a rounds that's out there. But the answer by @snapey makes sense.
Edit:
One main reason I like PHP and frameworks like Laravel:
No maven or gradle to deal with.
Especially gradle, it can be a pain to get everything updated.