我们正在尝试创建一个也使用 Spark 的 Scala 项目,但我们在读取扩展文件“intellij_info_bundled.bzl”时遇到问题:没有这样的包“@intellij_aspect//”:在 C:/users// 中找不到 WORKSPACE 文件_bazel_user/i45wuf6d/external/intellij_aspect。Intellij 中是否缺少某些内容?
斯卡拉文件
包 src.main.scala
object HelloWorld extends App {
def main(args: Array[String]) {
println("Hello, world!")
} }
构建文件
package(default_visibility = ["//visibility:public"])
load("@io_bazel_rules_scala//scala:scala.bzl", "scala_library", "scala_test")
scala_library(
name = "hello-world",
srcs = glob(["src/main/scala/*.scala"]),
)
scala_test(
name = "Hello_test",
srcs = glob(["src/main/scala/*.scala"]),
size = "small", # Expect this test to run quickly
)
工作空间
workspace(name = "scala_example")
rules_scala_version="7522c866450cf7810eda443e91ff44d2a2286ba1" # update this as needed
http_archive(
name = "io_bazel_rules_scala",
url = "https://github.com/bazelbuild/rules_scala/archive/%s.zip"%rules_scala_version,
type = "zip",
strip_prefix= "rules_scala-%s" % rules_scala_version
)
load("@io_bazel_rules_scala//scala:scala.bzl", "scala_repositories")
scala_repositories()`enter code here`
# register default scala toolchain
load("@io_bazel_rules_scala//scala:toolchains.bzl", "scala_register_toolchains")
scala_register_toolchains()
来自控制台的命令和错误
命令:C:\ProgramData\chocolatey\bin\bazel.exe build --tool_tag=ijwb:IDEA:community --keep_going --curses=no --color=yes --experimental_ui=no --progress_in_terminal_title=no --aspects =@intellij_aspect//:intellij_info_bundled.bzl%intellij_info_aspect --override_repository=intellij_aspect=C:\Users\ADMIN.IdeaIC2017.3\config\plugins\ijwb\aspect --output_groups=intellij-compile-java,intellij-compile-py - //...:全部
信息:加载完成。正在分析...错误:读取扩展文件“intellij_info_bundled.bzl”时遇到错误:没有这样的包“@intellij_aspect//”:在 C:/users/admin/appdata/local/temp/_bazel_sandhya/criyrv6d/ 中找不到 WORKSPACE 文件外部/intellij_aspect。信息:找到 3 个目标...警告:无法为前缀“bazel-”创建一个或多个便捷符号链接:无法创建符号链接 bazel-out -> C:/users/admin/appdata/local/temp/_bazel_sandhya/criyrv6d /execroot/scala_example/bazel-out:无法创建联结(名称=C:\users\admin\scalaprojects\example1\bazel-out,目标=C:\users\admin\appdata\local\temp_bazel_sandhya\criyrv6d\execroot\scala_example \bazel-out): 错误: src/main/native/windows/file-jni.cc(86): nativeCreateJunction(C:\users\admin\scalaprojects\example1\bazel-out, C:
无法创建符号链接 bazel-out -> C:/users/admin/appdata/local/temp/_bazel_sandhya/criyrv6d/execroot/scala_example/bazel-out: 无法创建连接 (name=C:\users\admin\scalaprojects\example1 \bazel-out, target=C:\users\admin\appdata\local\temp_bazel_sandhya\criyrv6d\execroot\scala_example\bazel-out): 错误: src/main/native/windows/file-jni.cc(86): nativeCreateJunction(C:\users\admin\scalaprojects\example1\bazel-out,C:\users\admin\appdata\local\temp_bazel_sandhya\criyrv6d\execroot\scala_example\bazel-out):错误:src/main/native/windows /file.cc(128): CreateJunction(\?\C:\users\admin\scalaprojects\example1\bazel-out): 当文件已经存在时无法创建文件。. 信息:正在构建... 错误:命令成功,但并未分析所有目标。信息:经过时间:18.108 秒,关键路径:0.05 秒
这只是一个示例 Helloworld 程序