Ayfri
02/27/2022, 11:29 AMhfhbd
02/27/2022, 11:32 AMVampire
02/27/2022, 11:47 AMcompileOnly
. But that is better suited for something like annotations that are really not necessary at usage time. An "optional" dependency is better modeled using feature variants. For Maven customers they will then land in scope optional
. For Gradle consumers they can depend on the feature variant they need and get the proper dependency without the need to declare it manually while not using it themselves.Ayfri
02/27/2022, 12:14 PMhfhbd
02/27/2022, 12:17 PMcore
and feature-x
. compileOnly
should not be used for features.