I have two maven projects in eclipse webapp
and serviceImpl
. webapp
references serviceImpl
.
When serviceImpl
project is closed in eclipse and I build and run the webapp
on Tomcat, the application works fine. But when I run webapp
while serviceImpl
is open, I get the error, that HTTP Status 500 - Configuration problem: Failed to import bean definitions from URL location [classpath:META-INF/serviceimpl-context.xml]
. If I look into the META-INF
folder on the machine I see that eclipse has deleted the xml file.
When I build and run the application on the command line or in IntelliJ, the problem does not appear either.
In eclipse the Deployment Assembly
settings of webapp
contains the open serviceImpl
project and source
references to some serviceImpl-2.0.0-SNAPSHOT.jar
.
Also Java Build Path
--> Libraries
--> Maven Dependencies
has the serviceImpl
node:
We are also using Spring Application Context.
EDIT:
When I do on the commandline:
mvn clean install -P build-modules-test -Dmaven.test.skip=true
then the xml file is created and the application works fine. But in eclipse "right-click project --> Maven --> Update project" deletes these files, but does not create them again...so the error occurs
As I commented, an "update project" is not the same as an mvn install
: the files are created during the package stage, stage which is not called during an Eclipse update.
See "Developing with Eclipse and Maven / Running Maven Builds"
You can define a Launch Execution setting with all the parameters you need:
Then you are sure to execute the same stages as the one done in command line through mvn install
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With