Strange error in Publishing when using properties in Repositories

I am consistently getting a strange error in publishing block when using properties in repositories block.

The details are available here: Configure publishing multiple times

I am not even entirely sure why this is happening but the behaviour seems like a bug (unless I have made an obvious mistake somewhere).

This is actually due to the use of project.properties. This causes all the project’s properties to be evaluated, including all extensions, such as the the publishing extension. Because the extension is a deferred configurable, once it has been evaluated, future attempts to mutate it will fail. Instead you should use the Project.property() method.

url "${project.property('mavenRepoUrl')}/repo"
1 Like

You know what, Mark, that actually make sense. I made that change and now it is all working. Cheers.

Would project.mavenRepoUrl work as well ?

That should also work.