That definitely does happen with really poorly considered starting points, but in my experience it's also maybe a day's work to pull that apart and put it into Maven/Gradle (unless you've also got, like, some really terrifying ant stuff to go with it, and even then you can sometimes ask "is this even necessary?" and get with the chopping down).
IntelliJ even has tooling to get you started:
https://www.jetbrains.com/help/idea/convert-a-regular-projec...