2

我使用 Dataflow 的项目编译得很好

mvn compile

但是,当我将项目导入 eclipse 时,eclipse 无法构建项目并给出以下错误

该项目未构建,因为其构建路径不完整。
找不到 com.google.common.reflect.TypeToken 的类文件。
修复构建路径,然后尝试构建此项目
4

1 回答 1

5

Adding an explicit dependency on Guava to my pom file appears to have fixed the problem.

<dependency>
  <groupId>com.google.guava</groupId>
  <artifactId>guava</artifactId>
  <version>[18.0,)</version>
</dependency>

By running

mvn dependency:tree -Dverbose -Dincludes=com.google.guava

I learned that I had several dependencies that were pulling in Guava so by adding an explicit dependency I was able to force maven to pull in a newer version.

However, I don't know why running 'mvn compile' on the command line worked.

于 2015-01-18T19:13:12.190 回答