Eclipse找不到com.google.common.reflect.TypeToken类?
我使用数据流的项目使用Eclipse找不到com.google.common.reflect.TypeToken类?,eclipse,maven,guava,google-cloud-dataflow,Eclipse,Maven,Guava,Google Cloud Dataflow,我使用数据流的项目使用 mvn compile 但是,当我将项目导入eclipse时,eclipse无法构建该项目,并给出以下错误 The project was not built since its build path is incomplete. Cannot find the class file for com.google.common.reflect.TypeToken. Fix the build path then try building this project 未
mvn compile
但是,当我将项目导入eclipse时,eclipse无法构建该项目,并给出以下错误
The project was not built since its build path is incomplete.
Cannot find the class file for com.google.common.reflect.TypeToken.
Fix the build path then try building this project
未生成项目,因为其生成路径不完整。
找不到com.google.common.reflect.TypeToken的类文件。
修复生成路径,然后尝试生成此项目
在我的pom文件中添加对Guava的显式依赖似乎解决了这个问题
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>[18.0,)</version>
</dependency>
我了解到我有几个依赖项在使用Guava,所以通过添加一个显式依赖项,我能够迫使maven使用一个更新的版本
但是,我不知道为什么在命令行上运行“mvn compile”会起作用。Eclipse项目是否配置为由Maven处理?即,项目图标上是否有一个小“M”?
mvn dependency:tree -Dverbose -Dincludes=com.google.guava