【问题标题】:Build maven project with using buck使用 buck 构建 maven 项目
【发布时间】:2015-10-10 06:35:13
【问题描述】:

当我用我的旧 maven 项目测试它时,我遇到了来自 facebook 的 BUCK 构建工具的问题。

我有这样的东西:

-rw-r--r--  1 piotr users  259 10-03 19:59 BUCK
-rw-r--r--  1 piotr users  235 10-03 19:56 .buckconfig
drwxr-xr-x  5 piotr users 4096 10-03 19:58 buck-out/
-rw-r--r--  1 piotr users  267 10-03 19:59 BUILD
drwxr-xr-x  2 piotr users 4096 08-11 16:53 configs/
-rw-r--r--  1 piotr users 3988 09-04 11:55 pom.xml
drwxr-xr-x  3 piotr users 4096 09-04 17:18 src/

猫.buckconfig

[java]
    src_roots = /src/main/java/, /src/main/resources/
    source_level = 8
    target_level = 8

[download]
    maven_repo = http://repo.maven.apache.org/maven2/
    in_build = true

[project]
    ignore = .git, target

猫构建

java_binary(
    name = "app",
    main_class = "com.example.daemon.Server",
    runtime_deps = [":main"],
)

java_library(
    name = "main",
    srcs = glob(["src/main/java/**/*.java"]),
    resources = glob(["src/main/resources/**"]),
    deps = ["@gson//jar"],

猫巴克

java_binary(
    name = "app",
    main_class = "com.example.daemon.Server",
    deps = [":main"],
)

java_library(
    name = "main",
    srcs = glob(["src/main/java/**/*.java"]),
    resources = glob(["src/main/resources/**"]),
    deps = ["//dep:gson"],
)

我尝试命令:

buck targets
Not using buckd because watchman isn't installed.
[+] PROCESSING BUCK FILES...0,0s [100%]
BUILD FAILED: Couldn't get dependency '//dep:gson' of target '//:main':
No build file at dep/BUCK when resolving target //dep:gson.
 ✘  ~/p/replication-daemon   :  ➦ 16ae702  ±  

如何将 maven 存储库添加到 buck 项目? (就像在这种情况下的 gson 一样)我正在寻找任何示例,但我没有找到任何东西......

如果有任何答案,我将不胜感激......

【问题讨论】:

  • dep 下没有BUCK 文件,对吧?
  • 那么下面@Tommy 的回答是解决这个问题的正确方法:)

标签: java maven buck


【解决方案1】:

您可以使用buck fetchremote_file 规则。或者更好的是,将 jar 签入存储库并使用 prebuilt_jar 规则。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-02-21
    • 2014-05-16
    • 2013-09-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-04-12
    • 2011-03-21
    相关资源
    最近更新 更多