Skip to content

Ensure Maven imports are tagged with maven_coordinates #169

@SanjayVas

Description

@SanjayVas

rules_proto imports the protobuf-java library from Maven using the java_import_external macro. Unlike the sibling jvm_maven_import_external macro, this macro does not set the maven_coordinate tag which is read by rules_jvm_external in order to ensure that exported artifacts have the appropriate artifact dependencies. Not having this results in exported Maven artifacts including protobuf-java directly rather than as an artifact dependency. This can result in downstream users having duplicate copies of protobuf-java, possibly with different versions.

rules_proto should either switch to jvm_maven_import_external or specify the maven_coordinate manually.

Related interaction with rules_jvm_external

If a project depends on rules_proto for java_proto_library and also uses rules_jvm_external for other Maven dependencies, it could result in a library depending on multiple versions of protobuf-java. To avoid this, downstream projects can specify the protobuf-java targets from @com_google_protobuf in the override_targets attribute of maven_install.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3We're not considering to work on this, but happy to review a PR. (No assignee)bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions