2015-10-03 140 views
1

当我使用旧的maven项目对其进行测试时,我遇到了来自Facebook的降压构建工具问题。使用降压构建maven项目

我有某事像这样:

-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 

猫BUILD

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"], 

猫BUCK

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仓库降压项目? (就像在这种情况下GSON)我正在寻找任何的例子,但我没有发现任何东西......

我会gratefull任何答案...

+0

你在'dep'下没有'BUCK'文件,对不对? – sdwilsh

+0

是的,正好:) – pkruk

+0

然后下面的@Tommy的答案是解决这个问题的正确方法:) – sdwilsh

回答