在pom.xml文件中做如下配置
<build>
<plugins>
<plugin>
<groupId>cn.smallbun.screw</groupId>
<artifactId>screw-maven-plugin</artifactId>
<version>1.0.5</version>
<!--数据库链接 各自配置-->
<dependencies>
<dependency>
<groupId></groupId>
<artifactId></artifactId>
<version></version>
</dependency>
</dependencies>
<configuration>
<!--数据库配置 各自配置-->
<driverClassName></driverClassName>
<jdbcUrl></jdbcUrl>
<username></username>
<password></password>
<!--screw配置-->
<fileType>WORD</fileType>
<title>数据库文档</title>
<fileName>住房补贴系统数据库设计</fileName>
<description>数据库结构说明</description>
<version>${project.version}</version>
<openOutputDir>false</openOutputDir>
<produceType>freemarker</produceType>
</configuration>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
双击screw进行文档的生成
生成后文档在当前项目新生成的doc目录下
*
<fileType>WORD</fileType> 此处的值也可以是HTML以生成HTML文档
效果展示下图
学自b站