<plugin> <!-- Specify the maven code generator plugin --> <groupId>org.jooq</groupId> <artifactId>jooq-codegen-maven</artifactId> <!--<version>${jooq.version}</version>--> <!-- The plugin should hook into the generate goal --> <executions> <execution> <id>generate-mysql</id> <phase>generate-sources</phase> <goals> <goal>generate</goal> </goals> </execution> </executions> <!-- Manage the plugin's dependency. In this example, we'll use a MySQL database --> <dependencies> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.37</version> </dependency> </dependencies>
<!-- Specify the plugin configuration. The configuration format is the same as for the standalone code generator --> <configuration> <!-- JDBC connection parameters --> <jdbc> <driver>com.mysql.jdbc.Driver</driver> <url>jdbc:mysql://localhost:3306/test</url> <user>root</user> <password>root</password> </jdbc> <!-- Generator parameters --> <generator> <database> <name>org.jooq.util.mysql.MySQLDatabase</name> <includes>.*</includes> <inputSchema>test</inputSchema><!--database name--> </database> <target> <packageName>me.lty.data</packageName> <directory>src/main/java</directory> </target> </generator> </configuration> </plugin>