Idea2016-maven Multi-Module project construction-spring+springmvc+hibernate_maven

Source: Internet
Author: User

On the network to view dozens of articles on the idea of building a MAVEN multi-module project of the blog and article, finally, today is done, here I divided the module to create a common springmvc+spring+hibernate development environment, the project structure is as follows:


First click new->project->


Here with the default MAVEN configuration, do not tick the create from Archetype! direct Next, Balabala, finish ...

Then, delete the SRC directory;

Then select the default Maven project as New->modelu->, and also uncheck the Create from archetype, creating Controller,dao,daoimpl,service,serviceimpl, The Spring,spring module is where the configuration files are stored. Once created, you can see something like this in the Pom.xml of the main module:


See something like this in the Pom.xml in the sub module.

<parent>
    <artifactId>multiModuleDemo</artifactId>
    <groupid>com.demo</ groupid>
    <version>1.0.0</version>
</parent>
This is an indication of the aggregation between the modules.


Of course, you can also create a util module, used to do third-party libraries or tool classes are OK, I do not ...


The last thing to create Mmd-web is to choose WebApp, because this is the equivalent of Webroot in Eclipse, or webcontent in MyEclipse,


Once created,


Then the most important write pom.xml the dependencies between each module:

First, Mmd-controller:

<dependencies>
    <dependency>
        <groupId>com.demo</groupId>
        <artifactId> mmd-service</artifactid>
        <version>1.0.0</version>
    </dependency>
    < dependency>
        <groupId>com.demo</groupId>
        <artifactid>mmd-serviceimpl</ artifactid>
        <version>1.0.0</version>
    </dependency>
</dependencies>

Mmd-dao:

<dependencies>
    <dependency>
        <groupId>com.demo</groupId>
        <artifactId> mmd-entity</artifactid>
        <version>1.0.0</version>
    </dependency>
</ Dependencies>

Mmd-daoimpl:

<dependencies>
    <dependency>
        <groupId>com.demo</groupId>
        <artifactId> mmd-dao</artifactid>
        <version>1.0.0</version>
    </dependency>
    < dependency>
        <groupId>com.demo</groupId>
        <artifactid>mmd-entity</artifactid >
        <version>1.0.0</version>
    </dependency>
</dependencies>

Mmd-entity:

No


Mmd-service:

<dependencies>
    <dependency>
        <groupId>com.demo</groupId>
        <artifactId> mmd-daoimpl</artifactid>
        <version>1.0.0</version>
    </dependency>
    < dependency>
        <groupId>com.demo</groupId>
        <artifactId>MMD-entity</artifactId>
        <version>1.0.0</version>
    </dependency>
</dependencies>


Mmd-serviceimpl:

<dependencies>
    <dependency>
        <groupId>com.demo</groupId>
        <artifactId> mmd-dao</artifactid>
        <version>1.0.0</version>
    </dependency>
    <dependency >
        <groupId>com.demo</groupId>
        <artifactId>MMD-daoImpl</artifactId>
        < version>1.0.0</version>
    </dependency>
    <dependency>
        <groupid>com.demo </groupId>
        <artifactId>MMD-service</artifactId>
        <version>1.0.0</version >
    </dependency>
</dependencies>


Mmd-spring: None


Mmd-web:

<dependencies> <dependency> <groupId>junit</groupId> &LT;ARTIFACTID&GT;JUNIT&L t;/artifactid> <version>3.8.1</version> <scope>test</scope> </dependency > <dependency> <groupId>com.demo</groupId> <artifactid>mmd-controller</a rtifactid> <version>1.0.0</version> </dependency> <dependency> <grou Pid>com.demo</groupid> <artifactId>MMD-daoImpl</artifactId> <version>1.0.0</ version> </dependency> <dependency> <groupId>com.demo</groupId> <art Ifactid>mmd-serviceimpl</artifactid> <version>1.0.0</version> </dependency>
        ;d ependency> <groupId>com.demo</groupId> <artifactId>MMD-spring</artifactId> <version>1.0.0</version> </dependency> </dependencies> 

After writing, remember, click


In this way, the module of the dependence on the written, about the construction of the SPRINGMVC environment here will not say, and the usual ways to build no difference, what you do not understand, click on the left of my blog QQ number, add me and I contact it.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.