I'm trying to use mvn install
, but I keep getting this error
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]
In my InitServlet.java I have all the imports, and it has no errors. In the pom.xml I have all dependencies needed, but this problem always persists.
All the other solutions tell me to add the dependency and use Maven Update, but it is definitely not missing code/dependencies, because this project is being shared with 2 other users, and it works fine on the other machines. It is the exact same project.
I had this working for a few hours, after countless tries of mvn clean install
, one of them got the BUILD SUCCESS and I didn't change anything, and it was working fine. But later, after changing some java files, I used mvn clean install
, and got again the same error.
Any ideias of what it might be?
Thanks in advance.
I fixed it. Apparently it really needed 2 more dependencies on a pom.xml that was on another folder. I needed to add to a pom.xml that was in a core folder, these 2 dependencies.
<dependency>
<groupId>org.terasoluna.plus.framework</groupId>
<artifactId>terasoluna-plus-web-conf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
</dependency>
After adding it, I ran mvn clean install
, and it installed successfully. Thank you anyway for all your help.