It seems that resolving the earlib configuration in one project prevents a different project to apply the maven-publish plugin. Simply running ‘gradlew’ in the sample ploject will result in:
What went wrong:
A problem occurred evaluating project ‘:common’.
Failed to apply plugin [class ‘org.gradle.api.publish.plugins.PublishingPlugin’]
Cannot add rule PublishingPlugin.Rules#tasksDependOnProjectPublicationRegistry for model element ‘tasks’ at state Initialized as this element is already at state SelfClosed.
In your common project you have this line: `evaluationDependsOn(’:server’), which will evaluate the server build script. The server build script resolves dependencies and it depends on the common project. So at that point the server project has already read the configuration of the common project. Now the control flow comes back to the common project and it tries to change the configuration. But it has already been read, which causes the error you saw.