I am writing a custom plugin for our organization to automatically configure Gradle with our internal repositories. I hit a snag where a Gradle build using the plugin is complaining about “Cannot configure the ‘publishing’ extension after it has been accessed”. From what I have Googled, it looks like this could be caused by accessing the repositories with a ‘getRepositories()’ call. So instead I tried to use the project.repositories closure. What I can’t figure out is how to use this closure in Java.
I assumed it would be something like this:
project1.repositories( repositoryHandler -> repositoryHandler.mavenLocal() );
But it did not like that, it’s almost like the java closure doesn’t know what the type is. Does anyone have any suggestions on how to properly do this?
Thanks.
Edit: Removed some extra characters.