To clarify: "provided" should have been in the test runtime configuration, but not in the shipped runtime configuration (otherwise dep resolution for users would pull in provided deps, which should not happen)
On Thu, Dec 30, 2021 at 10:05 AM Luke Cwik <lc...@google.com> wrote: > During the migration to Gradle 7[1] the propdeps plugin was removed[2] > since there wasn't a newer version that was compatible with Gradle 7 and a > replacement couldn't be found. All existing usages of "provided" were moved > to "compileOnly" and "compileOnly" is being mapped to the "provided" maven > scope in the generated pom files. This has lead to two issues: > 1) provided was also part of the runtime configuration, so we are getting > a few class not found exceptions when running tests [3] > 2) the generated pom.xml will have a bunch of compile time only > annotations added as a provided dependency in the generated pom files[4] > > #1 can be fixed by adding the dependency to both the "compileOnly" and > "runtimeOnly" configurations or by adding dependency to the > "implementation" configuration > #2 will make the pom files messier which can lead to confusion for users > but shouldn't impact existing uses. > > There was a suggestion[4] to completely remove the usage of provided from > the generated pom.xml and have all our previously "provided" dependencies > declared as "implementation" allowing us to solve both #1 and #2 above. > > The largest usage of "provided" in the past was to packages related to the > hadoop ecosystem and afterwards it was for packages such as > junit/hamcrest/aircompressor in sdks/java/core which aren't required to use > the module but can provide additional features if the dependency exists. > > What should we migrate if anything to the "implementation" configuration > or should we try to recreate what we were doing with the "provided" > configuration in the past? > > 1: https://issues.apache.org/jira/browse/BEAM-13430 > 2: https://github.com/apache/beam/pull/16308 > 3: https://issues.apache.org/jira/browse/BEAM-13569 > 4: > https://github.com/apache/beam/blob/fe456b79419d1a67ebf13d7d4b6695fa1aa6204d/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy#L964 > 5: https://issues.apache.org/jira/browse/BEAM-13504 > >