java - 使用buck构建maven项目

标签 java maven buck

当我用我的旧 Maven 项目测试 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 一样)我正在寻找任何示例,但我没有找到任何内容......

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

最佳答案

您可以使用buck fetch ,以及 remote_file规则。或者更好的是,将 jar checkin 存储库并使用 prebuilt_jar规则。

关于java - 使用buck构建maven项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32925795/

相关文章:

c++ - 将 CMake 项目集成到 Buck 中的最佳方式是什么?

android - Buck vs Gradle,Android 构建系统的优缺点

java - 如何将字符串 "7/7"转换为 Int 1?

java - 我无法在 ubuntu 终端中打开 open-in-jd-gui.sh。如何使用 open-in-jd-gui.sh tar 文件

java.langIndexOutOfBoundException

java - 将项目转换为 Maven 项目后 JAR 内容不正确

java - maven 和我的应用程序之间有什么联系?

java - 如何为多个onClick()创建方法?

java - Maven找不到包

c++ - cxx_library 是否可以导出预处理器宏?