如何使用screw一键生成数据库文档
这篇文章主要讲解了“如何使用screw一键生成数据库文档”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“如何使用screw一键生成数据库文档”吧!
一. screw的配置配置pom文件
<?xmlversion="1.0"encoding="UTF-8"?><projectxmlns="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.0https://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/><!--lookupparentfromrepository--></parent><groupId>com.bee</groupId><artifactId>screw-demo</artifactId><version>0.0.1-SNAPSHOT</version><name>screw-demo</name><description>ScrewDemoforSpringBoot</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><!--mysqldriver--><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><!--jdbcurl--><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=falsespring.datasource.usename=rootspring.datasource.password=123456spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driverspring.datasource.xa.properties.useInformationSchema=true二. 通过Maven插件运行screw
IDEA中运行
Eclipse中运行
处理POM配置文件中的错误(也可以不管这个错误,直接运行)
运行
在Goals中输入:screw:run
三. 生成数据库各表的设计文档感谢各位的阅读,以上就是“如何使用screw一键生成数据库文档”的内容了,经过本文的学习后,相信大家对如何使用screw一键生成数据库文档这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是亿速云,小编将为大家推送更多相关知识点的文章,欢迎关注!
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。