maven - Spring project with multimodule -


i looking create spring web application , use maven build automation tool. prefer go multimodule application. reason modules are:

  1. i have admin module in application , user module. code changes in user module should not require testing of admin module.

  2. different development team work in user , admin modules

on pom module side tend go follows

project/pom.xml             #pom <modules> element project/parent/pom.xml      #parent pom project/modulex/pom.xml     #module 'x' project/moduley/pom.xml     #module 'y' 

question is, when go modules approach there best practice need follow on spring side?

use per-module applicationcontex

you might want application context each module:

... <servlet>     <servlet-name>main-project</servlet-name>     <servlet-class>org.springframework.web.servlet.dispatcherservlet</servlet-class>     <init-param>         <param-name>contextconfiglocation</param-name>         <param-value>web-inf/config/main-project-servlet.xml</param-value>     </init-param>     <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping>     <servlet-name>main-project</servlet-name>     <url-pattern>/</url-pattern> </servlet-mapping> <listener>     <listener-class>org.springframework.web.context.contextloaderlistener</listener-class> </listener>  <context-param>     <param-name>contextconfiglocation</param-name>     <param-value>         /web-inf/config/applicationcontext-modulex.xml         /web-inf/config/applicationcontext-moduley.xml     </param-value> </context-param> ... 

you need way put in same directory, /web-inf/config/ example, various application context maven assembly plugin or overlaying maven war plugin.


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

android - Keyboard hides my half of edit-text and button below it even in scroll view -

css - Make div keyboard-scrollable in jQuery Mobile? -