Skip to content

Commit

Permalink
Handle the case when mvn dependency has 4 parts.
Browse files Browse the repository at this point in the history
RELNOTES=n/a
PiperOrigin-RevId: 585775066
  • Loading branch information
wanyingd1996 authored and Google Java Core Libraries committed Nov 27, 2023
1 parent a482a3a commit 0646e08
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tools/maven/pom_file.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,15 @@ CLASSIFIER_DEP_BLOCK = """
</dependency>
""".strip()

DEP_PKG_BLOCK = """
<dependency>
<groupId>{0}</groupId>
<artifactId>{1}</artifactId>
<packaging>{2}</packaging>
<version>{3}</version>
</dependency>
""".strip()

def _pom_file(ctx):
mvn_deps = depset(
[],
Expand All @@ -160,6 +169,8 @@ def _pom_file(ctx):
continue
if len(parts) == 3:
template = DEP_BLOCK
elif len(parts) == 4:
template = DEP_PKG_BLOCK
elif len(parts) == 5:
template = CLASSIFIER_DEP_BLOCK
else:
Expand Down

0 comments on commit 0646e08

Please sign in to comment.