Locate sourceSet used to create artifact(s) in a ProjectDependency configuration

I need a generic way to reverse a JAR artifact in a ProjectDependency to the sourceSet used to generate the artifact.

I can’t find any obvious way to do this other than searching the project for the matching jar task. Is there an easier way.

I guess this is NOT possible since the JAR task will only have a reference to the compiled class files. I do not see a way to get back to the sourceSet task that created the .class outputs.