首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用buck构建maven项目

使用buck构建maven项目
EN

Stack Overflow用户
提问于 2015-10-04 02:08:34
回答 1查看 2.1K关注 0票数 2

当我用我以前的maven项目测试来自facebook的BUCK build工具时,我遇到了一个问题。

我有这样的东西:

代码语言:javascript
复制
-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/

cat .buckconfig

代码语言:javascript
复制
[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

cat构建

代码语言:javascript
复制
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"],

猫巴克

代码语言:javascript
复制
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"],
)

我试着使用命令:

代码语言:javascript
复制
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 )我正在寻找任何示例,但我没有找到任何东西……

我将非常感谢你的回答……

EN

回答 1

Stack Overflow用户

发布于 2015-10-10 06:35:13

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

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/32925795

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档