How do you override getName method of a DefaultProjectDependency?

I’d like to extend ‘DefaultProjectDepedency’ to override the ‘getName’ method. Is there a way to do this, and then add the class as a dependency in my project?

Currently getName is defined to return the project name, I want it to return the name of the published artifact associated with the project configuration.

‘DefaultProjectDependency’ is an internal class, and I wouldn’t recommend to mess with it. Which bigger problem are you trying to solve?

Thank you. I am trying to modify the dependency name from a project that is generated by gradle in the POM. From looking at the code, it appears to default always to the project name, and does not understand the fact that my project has second artifact with a different name.