Maven builds SpringMVC+Mybatis project in detail

 

Just about to build a project, I have gathered all the things that will be used, I hope it will be useful to you. (The test project has been built, there is a problem when uploading, you can find me if you need it)

 

 

1. Maven environment construction and introduction:

http://blog.csdn.net/fengshizty/article/details/43019561

 

2. IDEA to create a Maven project tutorial:

http://blog.csdn.net/u011424470/article/details/52062133

 

 

3. Use Generator to automatically generate Mybatis related table information

      The Model, Mapping, and Dao files of the table are automatically generated. See the article http://blog.csdn.net/fengshizty/article/details/43086833 

and import it into the project's src/main/java package.

 

 

4. Maven builds the SpringMVC+Mybatis project in detail:

http://blog.csdn.net/u011424470/article/details/52067766

 

 

 

5. After the project is created, the mapper folder is not compiled during mvn clean. The solution is as follows:

In the pom.xml file add:

<resources>
    <!--Add .properties and *.xml package and compile plugins-->
<resource>
        <directory>src/main/java</directory>
        <includes>
            <include>**/*.properties</include>
            <include>**/*.xml</include>
        </includes>
        <filtering>false</filtering>
    </resource>
</resources>

 When compiling again, the mapper folder will be compiled.

 



 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326523253&siteId=291194637