My project which uses Dataflow compiles just fine using
我使用Dataflow的项目编译得很好
mvn compile
However when I import my project into eclipse, eclipse is unable to build the project and gives the following error
但是当我将项目导入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
1 个解决方案
#1
5
Adding an explicit dependency on Guava to my pom file appears to have fixed the problem.
将Guava的显式依赖添加到我的pom文件似乎解决了问题。
<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.
我了解到我有几个依赖于Guava的依赖,所以通过添加一个显式的依赖,我可以强制maven引入一个更新的版本。
However, I don't know why running 'mvn compile' on the command line worked.
但是,我不知道为什么在命令行上运行'mvn compile'有效。
#1
5
Adding an explicit dependency on Guava to my pom file appears to have fixed the problem.
将Guava的显式依赖添加到我的pom文件似乎解决了问题。
<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.
我了解到我有几个依赖于Guava的依赖,所以通过添加一个显式的依赖,我可以强制maven引入一个更新的版本。
However, I don't know why running 'mvn compile' on the command line worked.
但是,我不知道为什么在命令行上运行'mvn compile'有效。