【发布时间】:2018-01-11 18:50:45
【问题描述】:
我正在尝试使用mvn install,但我不断收到此错误
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.1:compile (default-compile) on project example-module-core: Compilation failure: Compilation failure:
[ERROR] /C:/terasoluna-plus/example-module-core/src/main/java/com/mycompany/project/module/util/InitServlet.java:[10,47] package org.springframework.web.context.support does not exist
[ERROR] /C:/terasoluna-plus/example-module-core/src/main/java/com/mycompany/project/module/service/impl/DatabaseServiceImpl.java:[9,50] package org.springframework.transaction.annotation does not exist
[ERROR] /C:/terasoluna-plus/example-module-core/src/main/java/com/mycompany/project/module/service/impl/DatabaseServiceImpl.java:[22,2] cannot find symbol
[ERROR] symbol: class Transactional
[ERROR] /C:/terasoluna-plus/example-module-core/src/main/java/com/mycompany/project/module/service/impl/InitializerServiceImpl.java:[11,50] package org.springframework.transaction.annotation does not exist
[ERROR] /C:/terasoluna-plus/example-module-core/src/main/java/com/mycompany/project/module/service/impl/InitializerServiceImpl.java:[28,2] cannot find symbol
[ERROR] symbol: class Transactional
[ERROR] /C:/terasoluna-plus/example-module-core/src/main/java/com/mycompany/project/example-module-core/src/main/java/com/mycompany/project/module/util/InitServlet.java:[25,11] cannot find symbol
[ERROR] symbol: variable SpringBeanAutowiringSupport
[ERROR] location: class com.mycompany.SIAR.module.util.InitServlet
[ERROR] -> [Help 1]
在我的 InitServlet.java 中,我有所有的导入,并且没有错误。在 pom.xml 中我有所有需要的依赖项,但这个问题总是存在。
所有其他解决方案都告诉我添加依赖项并使用 Maven 更新,但它绝对不会缺少代码/依赖项,因为这个项目正在与其他 2 个用户共享,并且它在其他机器上运行良好。这是完全相同的项目。
我让这个工作了几个小时,在无数次尝试mvn clean install 之后,其中一个获得了 BUILD SUCCESS 并且我没有改变任何东西,它工作正常。但是后来改了一些java文件后,我用mvn clean install,又报同样的错误。
你有什么想法吗?
提前致谢。
【问题讨论】:
标签: spring maven web-applications maven-2 maven-plugin