Programmatically adding dependencies

You don’t necessarily need to invent your own thirdPartyDependencies block for this. Your plugin can just provide a map of values which is used from the regular dependencies block as follows:

dependencies {
  compile libraries.log4j
  compile libraries['springframework.core']