How do you programmatically access resolved implementation dependencies?

I would like to access the metadata about a resolved implementation dependency that has its version set via a platform bom

  dependencies {
      implementation platform("internal.spinnaker:clouddriver-bom:${spinnakerRelease}")
      annotationProcessor platform("internal.spinnaker:clouddriver-bom:${spinnakerRelease}")
      testAnnotationProcessor platform("internal.spinnaker:clouddriver-bom:${spinnakerRelease}")

      implementation "com.netflix.spinnaker.clouddriver:clouddriver-web"
      implementation "com.netflix.spinnaker.clouddriver:clouddriver-core"
      implementation "com.netflix.spinnaker.clouddriver:clouddriver-security"
  }

I would like to be able to programmatically access the resolved version of clouddriver-web.
All the solutions I can find online keep referencing code like this.

configurations.compile.resolvedConfiguration.firstLevelModuleDependencies

Which you cannot do with the implementation configuration as it throws an error about not being resolvable.

The end goal is to have the resolved dependency be an entry in META-INF/build-info.properties so that it can be used like so: https://www.vojtechruzicka.com/spring-boot-version/

I can’t figure out how to get the version in a task or gradle file.

Any help would be greatly appreciated, cheers!

You can access the resolution result using configurations.runtimeClasspath.incoming.resolutionResult.

The implementation configuration is just a set of dependencies. So you don’t “access the resolved implementation dependencies”. You have to ask Gradle what was resolved for compile (compileClasspath) or runtime (runtimeClasspath) or annotation processing (annotationProcessor), …