braintree / braintree_java

Braintree Java library
https://developer.paypal.com/braintree/docs/start/overview
MIT License
158 stars 99 forks source link

junit-vintage-engine missing testonly attribute #101

Closed Tomanow closed 2 years ago

Tomanow commented 2 years ago

General information

Issue description

After updating braintree-java from 3.6.0 to 3.12.0, Bazel builds error because the transitive dependency junit-vintage-engine is not marked with testonly attribute in the braintree-java SDK.

From a maven perspective, the solution is to add <scope>test</scope>.

The workaround is to add it as an exclusion in bazel_rje_deps.bzl:

maven.artifact("com.braintreepayments.gateway", "braintree-java", "3.12.0", 
    exclusions = [maven.exclusion("org.junit.vintage", "junit-vintage-engine")]),

Error Message

ERROR: /private/var/tmp/_bazel_tom/002f4fd2b31c5cad69dfeeb104c6807c/external/maven/BUILD:11459:12:
in java_import rule @maven//:org_junit_vintage_junit_vintage_engine:
non-test target '@maven//:org_junit_vintage_junit_vintage_engine'
depends on testonly target '@maven//:junit_junit' and doesn't have testonly attribute set
Tomanow commented 2 years ago

Resolved: #100