How to get gradle to report the published name instead of project name as a dependency

Say i have a project that declares dependency like so

dependencies {
	management platform(project(":spring-security-dependencies"))
	api project(':spring-security-core')
	api project(':spring-security-oauth2-core')
}

And the project :spring-security-core , has the project name and published name as different.
so while the project is named spring-security-core , the published name is something like below (eg)


publishing {
    publications {
        maven(MavenPublication) {
            groupId = 'org.gradle.sample'
            artifactId = 'library'
            version = '1.1'
            from components.java
        }
    }
}

Is there a way for gradle to tell me that the depednency is not on project spring-security-core but on org.gradle.sample:library?

i have attempted running the below dependency insight command but that does not help either

./gradlew :spring-security-oauth2-client:dependencyInsight --dependency spring-security-core --configuration=runtimeClasspath

I am looking at https://github.com/gradle/gradle/blob/master/platforms/software/dependency-management/src/main/java/org/gradle/api/internal/artifacts/result/DefaultResolvedComponentResult.java but i cant figure out if there is a way i can get the published name instead of project name reported as a depednency

It is most often a bad idea to manipulate the coordinates and version on the MavenPublication instead of adjusting the project properties accordingly.
Is there a version you cannot simply fix up the project properties, so that the publication’s default values are the expected ones?

i totally agree that the names and publishing version names being mismatched is a very bad idea.

But sadly, in this case it cannot be updated .

is there no way to relate the two via gradle apis or capabilities somehow?

I have no idea, but I guess not.
As you depend on that project, not on any publication it does.
You just manipulate the information under which the built artifact is published.