bazelbuild / migration-tooling

Migration tools for Bazel
Apache License 2.0
44 stars 30 forks source link

Update Transitive_maven_jar rule README to include repositories field #78

Open bot424f54 opened 6 years ago

bot424f54 commented 6 years ago

Currently following the README errors complaining about repositories option missing.

Fix by adding repository field to set the option example:

transitive_maven_jar( name = "dependencies", artifacts = [ "org.springframework.cloud:spring-cloud-config-server:1.3.0.RELEASE", ], repositories = ["",], )

fortuna commented 6 years ago

This is not a documentation issue. It's a real bug. The alternative repositories feature was broken in a5e687403ec59db52383a2c0996003e5ad18b6cf. Even if you specify an empty list it doesn't solve the problem, because that outputs an empty value in the command line, and you get the error:

Unable to parse options: Expected a value after parameter --repositories
Usage: <main class> [options]
...

A workaround is to revert to the previous commit:

http_archive(
    name = "trans_maven_jar",
    url = "https://github.com/bazelbuild/migration-tooling/archive/0f25a7e83f2f4b776fad9c8cb929ec9fa7cac87f.zip",
    type = "zip",
    strip_prefix = "migration-tooling-0f25a7e83f2f4b776fad9c8cb929ec9fa7cac87f",
)
bot424f54 commented 6 years ago

Hmm it worked when I put a local nexus repo url. Looks like github markdown killed my < URL OF REPO > in the repositories list. I haven't tried maven central as I am behind a proxy.

transitive_maven_jar( name = "dependencies", artifacts = [ "org.springframework.cloud:spring-cloud-config-server:1.3.0.RELEASE", ], repositories = ["< URL OF REPO >",], )

fortuna commented 6 years ago

@bot424f54 It works if you actually specify a url. It doesn't not work if you give an empty string, an empty list, or omit the repositories parameter, which used to be optional before.