-
Notifications
You must be signed in to change notification settings - Fork 237
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In multi-project Maven repos, it's common to create a Bill of Materials (BOM) `pom.xml` that shares the common dependencies the project uses, pinned at specific versions. The `maven_bom` rule gathers multiple `java_export` targets into a single unit, and creates the BOM from them. The dependencies included in the BOM are: - Ones that appear as dependencies of two or more of the `java_export`s the BOM is being created for. - Are not one of the `java_export`s the BOM is being created for.
- Loading branch information
Showing
23 changed files
with
723 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
...s/java-export/src/main/java/com/github/bazelbuild/rulesjvmexternal/example/io/BUILD.bazel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
load("@rules_jvm_external//:defs.bzl", "artifact", "java_export") | ||
|
||
java_export( | ||
name = "io", | ||
srcs = glob(["*.java"]), | ||
maven_coordinates = "com.example:bazel-io:0.0.1", | ||
visibility = [ | ||
"//:__pkg__", | ||
], | ||
deps = [ | ||
artifact("com.google.guava:guava"), | ||
], | ||
) |
21 changes: 21 additions & 0 deletions
21
.../java-export/src/main/java/com/github/bazelbuild/rulesjvmexternal/example/io/Printer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.github.bazelbuild.rulesjvmexternal.example.io; | ||
|
||
import com.google.common.collect.ImmutableList; | ||
|
||
import java.util.List; | ||
|
||
|
||
public class Printer { | ||
|
||
public void showGreeting(String personToGreet) { | ||
// We take a dep on guava so that we can show off BOM generation. | ||
// No-one sensible would write this code normally. | ||
List<String> messages = ImmutableList.of("Hello, ", personToGreet, "!"); | ||
|
||
for (String item : messages) { | ||
System.out.print(item); | ||
} | ||
System.out.print("\n"); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.