diff options
author | Dan Fabulich <DanFabulich@gmail.com> | 2016-02-08 20:01:34 +0000 |
---|---|---|
committer | Dmitry Lomov <dslomov@google.com> | 2016-02-09 12:19:53 +0000 |
commit | 825d7bd5459eeb1b9964340a238595517d86acbb (patch) | |
tree | 933631d5d0e8cafe23e530f0332d192f7394af2c /src | |
parent | 01d17e1b1ced49b7760de4c4fce409b99405cb52 (diff) |
Link to Maven coordinates in the maven_jar documentation.
[Maven coordinates](https://maven.apache.org/pom.html#Maven_Coordinates) can be more sophisticated than we want to document here (alternate packaging/classifiers).
Specifically, I needed to link to `json-lib-2.4-jdk15.jar` at https://repo1.maven.org/maven2/net/sf/json-lib/json-li[].4/json-lib-2.4-jdk15.jar. In Maven, you'd refer to that like this:
```
<dependency>
<groupId>net.sf.json-lib</groupId>
<artifactId>json-lib</artifactId>
<version>2.4</version>
<classifier>jdk15</classifier>
</dependency>
```
It turns out that this works great in Bazel, too, if you use Maven coordinates.
```
maven_jar (
name = "net.sf.json-lib_json-lib",
artifact = "net.sf.json-lib:json-lib:jar:jdk15:2.4",
)
```
But it took me some effort to find it. Adding this link would have helped me, and will probably help somebody else, too.
--
Reviewed-on: https://github.com/bazelbuild/bazel/pull/856
MOS_MIGRATED_REVID=114135334
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/bazel/rules/workspace/MavenJarRule.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/workspace/MavenJarRule.java b/src/main/java/com/google/devtools/build/lib/bazel/rules/workspace/MavenJarRule.java index 6936a54019..84ed2375f6 100644 --- a/src/main/java/com/google/devtools/build/lib/bazel/rules/workspace/MavenJarRule.java +++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/workspace/MavenJarRule.java @@ -36,7 +36,8 @@ public class MavenJarRule implements RuleDefinition { public RuleClass build(Builder builder, RuleDefinitionEnvironment environment) { return builder /* <!-- #BLAZE_RULE(maven_jar).ATTRIBUTE(artifact) --> - A description of a Maven artifact. + A description of a Maven artifact using + <a href="https://maven.apache.org/pom.html#Maven_Coordinates">Maven coordinates</a>. <p>These descriptions are of the form <groupId>:<artifactId>:<version>, see <a href="#maven_jar_examples">the documentation below</a> for an example. |