More improvements for Gradle scanning - type-safe accessors

Improved

From January 7th 2025, Snyk's improved Gradle scanner (available in Snyk Preview) will support type-safe project accessors in both Groovy and Kotlin.

Existing users of the new scanner should see the improved results in the next re-scan of their projects. Or, to start using the new scanner, see the documentation.

What are type-safe project accessors?

Gradle type-safe project accessors allow project references to be statically checked for correctness. Incorrectly specified project references trigger compilation errors, helping you catch build problems earlier.

Type-safe project accessors are an incubating Gradle feature, and can be enabled by adding the TYPESAFE_PROJECT_ACCESSORS feature preview to your settings file. For example:

// settings.gradle.kts
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")

Once enabled, you can reference a project ":commons:utils:some:lib" as projects.commons.utils.some.lib.