I have 2 Spring MVC apps using Spring 4.3. I'll call them app1 and app2.
app1 works fine. I run it from within Intellij using the tomcat7-maven-plugin (jetty:run goal) and all is well. Its WebApplicationInitializer is found and runs just fine.
Now in app2 I include app1 as a war dependency.
<dependency>
<groupId>com.mycompany</groupId>
<artifactId>app1</artifactId>
<type>war</type>
</dependency>
When I run app2, also using tomcat7-maven-plugin (jetty:run goal) I get the following (very well known) message:
INFO: No Spring WebApplicationInitializer types detected on classpath
I have checked my target directory and the app1's classes, including its WebApplicationInitializer are present both in the exploded war directory and the generated war itself. In fact, if I take the war and drop it in a real tomcat7, it loads just fine.
I also tried adding
<context:component-scan base-package="com.mycompany.path_to_initializer"/>
to app2's applicationContext. No dice.
Any idea as to why this doesn't work using the tomcat7 plugin?