如何使用screw一键生成数据库文档

47次阅读
没有评论

共计 2901 个字符,预计需要花费 8 分钟才能阅读完成。

这篇文章主要讲解了“如何使用 screw 一键生成数据库文档”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着丸趣 TV 小编的思路慢慢深入,一起来研究和学习“如何使用 screw 一键生成数据库文档”吧!

一. screw 的配置

配置 pom 文件

?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 https://maven.apache.org/xsd/maven-4.0.0.xsd 
  modelVersion 4.0.0 /modelVersion 
  parent 
  groupId org.springframework.boot /groupId 
  artifactId spring-boot-starter-parent /artifactId 
  version 2.2.9.RELEASE /version 
  relativePath /   !-- lookup parent from repository -- 
  /parent 
  groupId com.bee /groupId 
  artifactId screw-demo /artifactId 
  version 0.0.1-SNAPSHOT /version 
  name screw-demo /name 
  description Screw Demo for Spring Boot /description 
  properties 
  java.version 1.8 /java.version 
  /properties 
  dependencies 
  dependency 
  groupId org.springframework.boot /groupId 
  artifactId spring-boot-starter-web /artifactId 
  /dependency 
  dependency 
  groupId org.springframework.boot /groupId 
  artifactId spring-boot-starter-test /artifactId 
  scope test /scope 
  exclusions 
  exclusion 
  groupId org.junit.vintage /groupId 
  artifactId junit-vintage-engine /artifactId 
  /exclusion 
  /exclusions 
  /dependency 
  dependency 
  groupId cn.smallbun.screw /groupId 
  artifactId screw-core /artifactId 
  version 1.0.4 /version 
  /dependency 
  /dependencies 
  build 
  plugins 
  plugin 
  groupId org.springframework.boot /groupId 
  artifactId spring-boot-maven-plugin /artifactId 
  /plugin 
  plugin 
  groupId cn.smallbun.screw /groupId 
  artifactId screw-maven-plugin /artifactId 
  version 1.0.4 /version 
  dependencies 
  !-- HikariCP -- 
  dependency 
  groupId com.zaxxer /groupId 
  artifactId HikariCP /artifactId 
  version 3.4.5 /version 
  /dependency 
  !--mysql driver -- 
  dependency 
  groupId mysql /groupId 
  artifactId mysql-connector-java /artifactId 
  version 8.0.20 /version 
  /dependency 
  /dependencies 
  configuration 
  !--username -- 
  username root /username 
  !--password -- 
  password 123456 /password 
  !--driver -- 
  driverClassName com.mysql.cj.jdbc.Driver /driverClassName 
  !--jdbc url -- 
  jdbcUrl jdbc:mysql://localhost:3306/db_mybatis /jdbcUrl 
  !-- 生成文件类型  -- 
  fileType HTML /fileType 
  !-- 打开文件输出目录  -- 
  openOutputDir false /openOutputDir 
  !-- 生成模板  -- 
  produceType freemarker /produceType 
  !-- 描述  -- 
  description 数据库文档生成 /description 
  !-- 版本  -- 
  version 1.0.0 /version 
  !-- 标题  -- 
  title 数据库文档 /title 
  /configuration 
  executions 
  execution 
  phase compile /phase 
  goals 
  goal run /goal 
  /goals 
  /execution 
  /executions 
  /plugin 
  /plugins 
  /build 
 /project

配置数据源
src/main/resources/application.properties

spring.datasource.url=jdbc:mysql://localhost:3306/db_mybatis?useUnicode=true characterEncoding=UTF-8 useSSL=false
spring.datasource.usename=root
spring.datasource.password=123456
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.xa.properties.useInformationSchema=true

二. 通过 Maven 插件运行 screw

IDEA 中运行

Eclipse 中运行

处理 POM 配置文件中的错误(也可以不管这个错误,直接运行)

运行

在 Goals 中输入:screw:run

三. 生成数据库各表的设计文档

感谢各位的阅读,以上就是“如何使用 screw 一键生成数据库文档”的内容了,经过本文的学习后,相信大家对如何使用 screw 一键生成数据库文档这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是丸趣 TV,丸趣 TV 小编将为大家推送更多相关知识点的文章,欢迎关注!

正文完
 
丸趣
版权声明:本站原创文章,由 丸趣 2023-07-13发表,共计2901字。
转载说明:除特殊说明外本站除技术相关以外文章皆由网络搜集发布,转载请注明出处。
评论(没有评论)