I tried setting up a very simple project (three java projects, one that depends on the other two) and maven publish just works without having to wrap it in an afterEvaluate block.
Since I don’t have a minimal failing project, I can’t really say it is a surefire fix, i just know on my (large and complicated) project, dependencies were not showing up and putting the publishing.publications into an afterEvaluate block seemed to resolve it.