Java项目:运行sbt compile时出错

时间:2017-11-09 19:08:24

标签: java compilation java-8 sbt

我有一个缺少任何依赖管理的java项目。选择SBT来添加依赖关系管理并构建它。

我在项目中添加了build.sbt,sbt.plugins。当我尝试编译项目时,我看到src / main中存在但在src / test中访问的类的错误。

$ sbt compile
[info] Loading settings from plugins.sbt ...
[info] Loading project definition from C:\web\web_automation\project
[info] Loading settings from build.sbt ...
[info] Set current project to web_automation (in build file:/C:/web/web_automation/)
[info] Executing in batch mode. For better performance use sbt's shell
[info] Compiling 385 Java sources to C:\web\web_automation\target\classes ...
[error] C:\web\web_automation\src\main\java\com\Wait.java:4:1:  error: cannot find symbol
[error] import GlobalConfig;
[error]                                           ^^  symbol:   class GlobalConfig

知道导致这些错误的原因吗?

build.sbt

// Project name (artifact name in Maven)
name := "web_automation"

// orgnization name (e.g., the package name of the project)
organization := ""

version := "1.0-SNAPSHOT"

// project description
description := "Selenium Automated tests for web."

// Enables publishing to maven repo
publishMavenStyle := false

// Do not append Scala versions to the generated artifacts
crossPaths := false

// This forbids including Scala related libraries into the dependency
autoScalaLibrary := false

// library dependencies. (orginization name) % (project name) % (version)
libraryDependencies ++= Seq(
  "org.apache.commons" % "commons-math3" % "3.1.1",
  "org.fluentd" % "fluent-logger" % "0.2.10",
  "org.seleniumhq.selenium" % "selenium-java" % "3.6.0",
  "org.uncommons" % "reportng" % "1.1.4"
)

enablePlugins(TestNGPlugin)

0 个答案:

没有答案