我使用gradle相对较新,并且无法理解依赖项。我一直在使用Apache POI库从excel读取一个项目,最初我将JAR下载到我的项目中,它完全正常。当我将项目放在GitLab上时,我决定使用gradle依赖项(据我所知,它与使用JAR相同,但在共享项目时更好,因为您不必下载它们?)。这适用于大多数进口产品;但是,由于某种原因,我的项目不再能够导入CellType。我暂时重新下载了JAR,它再次起作用。
问题摘要:
为什么CellType是唯一停止工作的东西,为什么它停止工作?有什么不同呢?
编辑:这是我的build.gradle
中的依赖项部分compile 'com.google.apis:google-api-services-sheets:v4-rev499-1.23.0'
testCompile group: 'org.testng', name: 'testng', version: '6.9.10'
compile group: 'org.seleniumhq.selenium', name: 'selenium-java', version: '3.8.1'
// https://mvnrepository.com/artifact/com.google.oauth-client/google-oauth-client-java6
compile group: 'com.google.oauth-client', name: 'google-oauth-client-java6', version: '1.11.0-beta'
// https://mvnrepository.com/artifact/com.google.oauth-client/google-oauth-client-jetty
compile group: 'com.google.oauth-client', name: 'google-oauth-client-jetty', version: '1.11.0-beta'
// https://mvnrepository.com/artifact/org.apache.poi/poi
compile group: 'org.apache.poi', name: 'poi', version: '3.9'
// https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml
compile group: 'org.apache.poi', name: 'poi-ooxml', version: '3.9'
// https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml-schemas
compile group: 'org.apache.poi', name: 'poi-ooxml-schemas', version: '3.17'
// https://mvnrepository.com/artifact/org.apache.commons/commons-collections4
compile group: 'org.apache.commons', name: 'commons-collections4', version: '4.1'
(抱歉:#)
我得到的编译错误是“无法解决”(导入语句变为红色)
import org.apache.poi.ss.usermodel.CellType;