Mybatis framework source code notes (1) Compiling Mybatis source code and preparing the source code debugging environment

1 Introduction to source code version

     I have been studying the source code of the Mybatis open source framework recently. Generally speaking, the source code of this framework is relatively simple and easy to understand. Here is a summary of some key points and ideas in the source code learning process. Record. The Myabtis version I downloaded here is version 3.5.11. The download link address is as follows:
Source code download address: http://github.com/mybatis /mybatis-3

2 How to compile Mybatis source code

First download the source code package from github to the local area.
The project source code of Mybatis is built using maven. Here we can directly use maven to compile and package.
Use idea to open it. After the project is loaded, you can use maven to compile and package it.
Insert image description here
The packaged package will be automatically generated under the specified coordinates and version in our local warehouse.
Insert image description here
Now we can use the mybatis package in our test project, and we can add our own comments arbitrarily in the source code.

3 Use Mybatis to set up the source code debugging environment

Through the second step, we have completed compiling the source code of Mybatis, and then we can use our own packaged Mybatis in our own projects.
Create a new maven project, add database driver and Mybatis dependencies
Insert image description here
Open the project structure
Insert image description here
Change the source code path of the mybatis package of the current project Associate it with the path of our own mybatis source code package downloaded from github, and save the changes.
Insert image description here
Later, if we view the source code or debug, it will automatically be associated with the mybatis source code we downloaded ourselves, so that we can write Chinese comments in the source code and set breakpoints for debugging. .
Insert image description here
The above is the entire process of mybatis source code compilation and source code debugging environment construction.

Guess you like

Origin blog.csdn.net/qq_41865652/article/details/126382448