maven - How to download dependencies using bazel -


i new bazel. need download external dependency jar files using bazel. configure download external jar files. tried add jar files in build , workspace files , not working

appreciate quick response

workspace file

maven_server(name="myserver",url="https://mvnrepository.com/artifact/org.apache.flink/flink-java") maven_jar(name="flink-java",artifact="org.apache.flink:filnk-java:jar:1.2.0",server="myserver") bind(name="flink-java",actual="@flink-java//jar") 

build file

java_binary( name="read_files", srcs = glob(["readfiles.java"]), main_class="com.ibm.cdo.gts.contracts.pipeline.preprocess.readfiles", deps=["//external:flink-java"], ) 

thanks,

the logical mistake have there workspace name (flink-java) illegal [1] [2].
needed change - _ in maven_jar , of course reference in bind.

maven_jar(name="flink_java",artifact="org.apache.flink:flink-java:jar:1.2.0") bind(name="flink-java",actual="@flink_java//jar") 

two more mistakes had in above were:

  1. in artifact coordinates wrote filnk-java when needed flink-java
  2. the mvnrepository url used doesn't seem legal. tried few variants couldn't work. additionally site seem link downloads maven central i'm not sure server jars. having said since bazel fallbacks maven central omitted maven_server , build passes. if need maven_server part , need use private maven repository please double check url first.

p.s.- have helped if added question bazel outputs since needed create own workspace know problems encountered. many times people ignore question without enough details.
luck.

[1] https://bazel.build/versions/master/docs/be/workspace.html#maven_jar_name
[2] https://bazel.build/versions/master/docs/be/functions.html#workspace


Comments

Popular posts from this blog

How to understand 2 main() functions after using uftrace to profile the C++ program? -

c# - Update a combobox from a presenter (MVP) -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -