screw简单生成数据库说明文档

创建一个maven项目

image

在pox.xml文件配置如下信息

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.example</groupId>
    <artifactId>getDatabaseExplain</artifactId>
    <version>1.0-SNAPSHOT</version>


    <build>
        <plugins>
            <plugin>
                <groupId>cn.smallbun.screw</groupId>
                <artifactId>screw-maven-plugin</artifactId>
                <version>1.0.5</version>
                <dependencies>
                    <!-- https://mvnrepository.com/artifact/cn.smallbun.screw/screw -->
                    <dependency>
                        <groupId>cn.smallbun.screw</groupId>
                        <artifactId>screw</artifactId>
                        <version>1.0.5</version>
                        <type>pom</type>
                    </dependency>
                    <!-- https://mvnrepository.com/artifact/com.zaxxer/HikariCP -->
                    <dependency>
                        <groupId>com.zaxxer</groupId>
                        <artifactId>HikariCP</artifactId>
                        <version>4.0.3</version>
                    </dependency>
                    <!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
                    <dependency>
                        <groupId>mysql</groupId>
                        <artifactId>mysql-connector-java</artifactId>
                        <version>8.0.25</version>
                    </dependency>

                </dependencies>
                <configuration>
                    <!-- 数据库相关配置-->
                    <driverClassName>com.mysql.cj.jdbc.Driver</driverClassName>
                    <jdbcUrl>jdbc:mysql://127.0.0.1:3306/database</jdbcUrl>
                    <username>database_user</username>
                    <password>database_passwd</password>
                    <!-- scrw配置-->
                    <fileType>HTML</fileType><!--文件类型 可以是HTML和WORD-->
                    <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>

</project>

刷一下maven依赖

双击screw:run 即可在doc目录下生成对于的文档

image

posted @ 2021-09-21 11:32  darling331  阅读(155)  评论(0编辑  收藏  举报