Skip to content

Propagate maven_coordinates tag to generated scala_import so pom generation includes the dependency #1568

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

vinnybod
Copy link
Contributor

Description

Add a maven_coordinates= tag to the generated scala maven dependency targets.

Motivation

rules_jvm_external pom generation uses the maven_coordinates=x:y:z tag to determine the formatting of a dependency in the pom. Because this tag is missing, the scala dependencies are excluded from the generated pom.
I need for example @io_bazel_rules_scala_scala_library//jar to appear in my generated pom as

<dependency>
    <groupId>org.scala-lang</groupId>
    <artifactId>scala-library</artifactId>
    <version>2.13.12</version>
</dependency>

Copy link

google-cla bot commented Apr 15, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@vinnybod
Copy link
Contributor Author

Still figuring out who in my company needs to deal with the CLA, but would love some feedback on this in the meantime.

attrs,
props,
additional_rule_attrs):
lines = [
"%s(" % rule_name,
" name = %s," % repr(name),
" jars = [%s]," % repr(path),
" tags = [\"maven_coordinates=%s\"]," % coordinates,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since coordinates is non mandatory attribute I think tags should be added conditionally rather than having empty maven_coordinates=. wdyt?

Copy link
Collaborator

@simuons simuons left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @vinnybod

@liucijus
Copy link
Collaborator

@vinnybod to get this merged, CLA needs to be signed

@vinnybod
Copy link
Contributor Author

@liucijus CLA was signed and submitted yesterday. It was a corporate CLA, so according to opensource.google/documentation/reference/cla#cla-accepted , it might take a couple days for it to process.

@vinnybod
Copy link
Contributor Author

CLA is approved

@simuons simuons merged commit 98689d0 into bazel-contrib:master Apr 25, 2024
2 checks passed
@vinnybod vinnybod deleted the vinnybod/propagate-maven-coordinate-tag branch April 25, 2024 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants