I have the maven spring application with such structure:
root
-core
-ws
-endpoints
-webapp
Core module contains business logic
Endpoints module contains classes @WebService
Webapp module contains web.xml
Endpoins module has several beans.
My web.xml has link to main context:
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
applicationContext.xml imports context of Endpoints module
<import resource="classpath:ws-context.xml"/>
I can launch the application in two ways:
- By Idea run configuration (jetty with artifcat)
- By jetty-maven-plugin (eclispe)
When I run it by Idea everything is ok. When I use jetty-maven-plugin I have following problem:
Spring finds ws-context.xml, but he doesn't read it. I have found out it by two experiments:
1.I remamed ws-context.xml and spring failed with error.
2.I made ws-context.xml invalid and spring didn't fail.
Unfortunately, I've lost my beans. What is wrong?
Jetty version 9+ (I tried different). My jetty config is below:
<configuration>
<war>${project.basedir}/target/${project.build.finalName}.war</war>
<systemProperties>
<force>true</force>
<systemProperty>
<name>jetty.home</name>
<value>/</value>
</systemProperty>
</systemProperties>
<webApp>
<contextPath>/</contextPath>
<extraClasspath>${basedir}/../../config/</extraClasspath>
</webApp>
</configuration>