Maven project split and integration

 

 

For now has maven ssh project split, split ideas: the dao layer of code that has been extracted from the configuration file of all to separate the performance of a project. Similarly Service , Action split.

ssh-parent:  Parent Project

DAO-SSH: (submodule)

ssh-service

ssh-web

Split the completion of the project split after polymerization, the concept of the parent project

1.1  Creating parent project

      

 

Create a good parent project directory structure: only pom.xml , it can be inferred that the parent project is not encoded.

1,  dependent on the information needs of the project, as defined in the parent project, sub-module succession process

2,  the individual submodules aggregated together

1.1.2  will create the parent project to publish a local warehouse

The future Service , DAO works published to a local warehouse. Release service engineering error.

If you forget this step, the parent project to publish a local warehouse.

1.2  Create a sub-module ssh-dao

Ssh-dao responsible for the data access layer: Contains dao relevant code & Profiles

    

1.2.1  The spring configuration file split

  

1.3  Create a sub-module ssh-service

    

The ssh-dao engineering packed into the local repository;

In the service project pom.xml add a file ssh-dao dependent

1.3.1  Unit Testing

1,  bulk loading spring configuration file

a) classpath:spring/applicationContext-*.xml

b)  the CLASSPATH *: the Spring / applicationContext - * xml. : it is necessary to load the project in the configuration file, but also to load the jar package configuration file

 

1.4  Create a sub-module SSH-Web : the WAR

  

In the ssh-web add items in service projects depend.

Web.xml

  

1.5  Run

Maven way:

Mode 1 : Run the parent project. The parent project submodules aggregated together. The ssh-web hit war package posted to tomcat

Mode 2 : direct running web project

other methods:

Deployed to the tomcat

Published 159 original articles · won praise 75 · views 190 000 +

Guess you like

Origin blog.csdn.net/xuehuagongzi000/article/details/79219626