错误详情如下:
[INFO] -------------------------------------------------------------
`[ERROR] COMPILATION ERROR : `
[INFO] -------------------------------------------------------------
`[ERROR] /D:/MyEclipse_2017_workspaces/Platform/web/src/main/java/com/jeesite/modules/test/entity/TestData.java:[69,66] 无法访问org.apache.commons.collections.ListUtils
找不到org.apache.commons.collections.ListUtils的类文件`
`[ERROR] /D:/MyEclipse_2017_workspaces/Platform/web/src/main/java/com/bjsasc/modules/mdmdecodetype/web/MdmDecodeTypeController.java:[202,59] 无法访问org.apache.commons.collections.MapUtils
找不到org.apache.commons.collections.MapUtils的类文件`
[INFO] 2 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 26.296 s
[INFO] Finished at: 2020-03-20T22:38:28+08:00
[INFO] ------------------------------------------------------------------------
`[ERROR]` Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project platform-web: Compilation failure: Compilation failure:
`[ERROR]` /D:/MyEclipse_2017_workspaces/Platform/web/src/main/java/com/jeesite/modules/test/entity/TestData.java:[69,66] 无法访问org.apache.commons.collections.ListUtils
`[ERROR]` 找不到org.apache.commons.collections.ListUtils的类文件
`[ERROR]` /D:/MyEclipse_2017_workspaces/Platform/web/src/main/java/com/bjsasc/modules/mdmdecodetype/web/MdmDecodeTypeController.java:[202,59] 无法访问org.apache.commons.collections.MapUtils
`[ERROR]` 找不到org.apache.commons.collections.MapUtils的类文件
`[ERROR]` -> [Help 1]
`[ERROR]`
`[ERROR]` To see the full stack trace of the errors, re-run Maven with the -e switch.
`[ERROR]` Re-run Maven using the -X switch to enable full debug logging.
`[ERROR]`
`[ERROR]` For more information about the errors and possible solutions, please read the following articles:
`[ERROR]` [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
【注】: 实际情况,查找org.apache.commons.collections.ListUtils 和 org.apache.commons.collections.MapUtils的jar包在项目Maven Dependencies中和Maven仓库中均存在,各Java类无异常。
解决方法:
(1)第一种情况
Java类代码中包含没有使用的import包(或未知的import包),删除即可解决。
(2)第二种情况(这次我遇到的问题,已解决,但原因未知
)
问题描述: Myeclipse校验整个Maven项目中有检验未通过的文件,如下图(和上述错误描述不对应)
步骤:
1)执行 Maven clean
[INFO] Scanning for projects...
[INFO]
[INFO] ----------------------< com.jeesite:platform-web >----------------------
[INFO] Building platform Web 4.1.7-SNAPSHOT
[INFO] --------------------------------[ war ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.0.0:clean (default-clean) @ platform-web ---
[INFO] Deleting D:\MyEclipse_2017_workspaces\Platform\web\target
[INFO] Deleting D:\MyEclipse_2017_workspaces\Platform\web\src\main\webapp\WEB-INF\classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.647 s
[INFO] Finished at: 2020-03-20T22:56:41+08:00
[INFO] ------------------------------------------------------------------------
2)执行 项目clean
3)执行Maven install(报上述错误,不用管
)
[INFO] -------------------------------------------------------------
`[ERROR] COMPILATION ERROR : `
[INFO] -------------------------------------------------------------
`[ERROR] /D:/MyEclipse_2017_workspaces/Platform/web/src/main/java/com/jeesite/modules/test/entity/TestData.java:[69,66] 无法访问org.apache.commons.collections.ListUtils
找不到org.apache.commons.collections.ListUtils的类文件`
`[ERROR] /D:/MyEclipse_2017_workspaces/Platform/web/src/main/java/com/bjsasc/modules/mdmdecodetype/web/MdmDecodeTypeController.java:[202,59] 无法访问org.apache.commons.collections.MapUtils
找不到org.apache.commons.collections.MapUtils的类文件`
[INFO] 2 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 26.296 s
[INFO] Finished at: 2020-03-20T22:38:28+08:00
[INFO] ------------------------------------------------------------------------
`[ERROR]` Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project platform-web: Compilation failure: Compilation failure:
`[ERROR]` /D:/MyEclipse_2017_workspaces/Platform/web/src/main/java/com/jeesite/modules/test/entity/TestData.java:[69,66] 无法访问org.apache.commons.collections.ListUtils
`[ERROR]` 找不到org.apache.commons.collections.ListUtils的类文件
`[ERROR]` /D:/MyEclipse_2017_workspaces/Platform/web/src/main/java/com/bjsasc/modules/mdmdecodetype/web/MdmDecodeTypeController.java:[202,59] 无法访问org.apache.commons.collections.MapUtils
`[ERROR]` 找不到org.apache.commons.collections.MapUtils的类文件
`[ERROR]` -> [Help 1]
`[ERROR]`
`[ERROR]` To see the full stack trace of the errors, re-run Maven with the -e switch.
`[ERROR]` Re-run Maven using the -X switch to enable full debug logging.
`[ERROR]`
`[ERROR]` For more information about the errors and possible solutions, please read the following articles:
`[ERROR]` [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
4)忽略检验(保证Maven项目中所有文件正确)
【注】: 步骤 3) ~ 4) 之间切记不要再执行 Maven clean操作 和 项目clean 操作。
5)再次执行Maven install(成功,原因未知
)
[INFO] Scanning for projects...
[INFO]
[INFO] ----------------------< com.jeesite:platform-web >----------------------
[INFO] Building platform Web 4.1.7-SNAPSHOT
[INFO] --------------------------------[ war ]---------------------------------
[WARNING] The POM for org.postgresql:postgresql:jar:42.2.5 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for commons-fileupload:commons-fileupload:jar:1.3.3 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for commons-beanutils:commons-beanutils:jar:1.9.3 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for org.apache.commons:commons-text:jar:1.3 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for org.codehaus.woodstox:stax2-api:jar:4.2 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for com.fasterxml.woodstox:woodstox-core:jar:6.0.0.pr2 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for org.apache.commons:commons-email:jar:1.5 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for com.twelvemonkeys.imageio:imageio-jpeg:jar:3.4.1 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for commons-logging:commons-logging:jar:1.0.4 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for com.google.zxing:core:jar:3.3.2 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for com.google.zxing:javase:jar:3.3.2 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for org.apache.commons:commons-collections4:jar:4.1 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[INFO] Downloading from maven-aliyun: http://192.168.1.141:8081/repository/maven-public/com/jeesite/jeesite-framework/4.1.7-SNAPSHOT/maven-metadata.xml
[WARNING] Could not transfer metadata com.jeesite:jeesite-framework:4.1.7-SNAPSHOT/maven-metadata.xml from/to maven-aliyun (http://192.168.1.141:8081/repository/maven-public/): Connect to 192.168.1.141:8081 [/192.168.1.141] failed: Connection timed out: connect
[WARNING] Failure to transfer com.jeesite:jeesite-framework:4.1.7-SNAPSHOT/maven-metadata.xml from http://192.168.1.141:8081/repository/maven-public/ was cached in the local repository, resolution will not be reattempted until the update interval of maven-aliyun has elapsed or updates are forced. Original error: Could not transfer metadata com.jeesite:jeesite-framework:4.1.7-SNAPSHOT/maven-metadata.xml from/to maven-aliyun (http://192.168.1.141:8081/repository/maven-public/): Connect to 192.168.1.141:8081 [/192.168.1.141] failed: Connection timed out: connect
[INFO]
[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ platform-web ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO] Copying 131 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ platform-web ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:3.0.2:testResources (default-testResources) @ platform-web ---
[INFO] Not copying test resources
[INFO]
[INFO] --- maven-compiler-plugin:3.7.0:testCompile (default-testCompile) @ platform-web ---
[INFO] Not compiling test sources
[INFO]
[INFO] --- maven-surefire-plugin:2.18.1:test (default-test) @ platform-web ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-war-plugin:3.1.0:war (default-war) @ platform-web ---
[INFO] Packaging webapp
[INFO] Assembling webapp [platform-web] in [D:\MyEclipse_2017_workspaces\Platform\web\target\platform-web]
[INFO] Processing war project
[INFO] Copying webapp resources [D:\MyEclipse_2017_workspaces\Platform\web\src\main\webapp]
[INFO] Webapp assembled in [955 msecs]
[INFO] Building war: D:\MyEclipse_2017_workspaces\Platform\web\target\web.war
[INFO]
[INFO] --- spring-boot-maven-plugin:2.0.8.RELEASE:repackage (default) @ platform-web ---
[INFO]
[INFO] --- maven-install-plugin:2.5.2:install (default-install) @ platform-web ---
[INFO] Installing D:\MyEclipse_2017_workspaces\Platform\web\target\web.war to D:\apache-maven-3.6.0\maven_3.6.0\repository\com\jeesite\platform-web\4.1.7-SNAPSHOT\platform-web-4.1.7-SNAPSHOT.war
[INFO] Installing D:\MyEclipse_2017_workspaces\Platform\web\pom.xml to D:\apache-maven-3.6.0\maven_3.6.0\repository\com\jeesite\platform-web\4.1.7-SNAPSHOT\platform-web-4.1.7-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
`[INFO] BUILD SUCCESS`
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 27.126 s
[INFO] Finished at: 2020-03-20T23:29:02+08:00
[INFO] ------------------------------------------------------------------------
结束。