Building from Source

All MyBatis Generator (MBG) distributions include source code. It is straight forward to compile MBG from source - simply unzip the source in a distribution and compile it with your favorite tool.

The MBG distribution does not contain the tests that are run during the build, or other classes that are a necessary part of the build. If you would like to inspect those classes, or build MBG from the very latest version of the source code at GitHub then follow these steps:

  1. MBG is built with Apache Maven. First you must get maven running. If you are new to Maven, here are the most simple steps (for Windows):
    1. Download a Maven distribution from
    2. Unzip the distribution somewhere convenient
    3. Setup environment variables and the PATH. Examples:
      set JAVA_HOME=C:\Program Files\java\jdk1.8.0_91
      set M2_HOME=C:\JavaTools\apache-maven-3.3.9
      set PATH=%PATH%;%M2_HOME%\bin;
  2. Clone or fork the official Git repo on GitHub
  3. Open a command window in the directory where you checked out the source
  4. cd core
  5. Run the command mvn clean install - or any of the other Maven lifecycle commands.