溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

如何使用screw一鍵生成數(shù)據(jù)庫文檔

發(fā)布時(shí)間:2023-02-15 09:30:57 來源:億速云 閱讀:241 作者:iii 欄目:數(shù)據(jù)庫

這篇文章主要講解了“如何使用screw一鍵生成數(shù)據(jù)庫文檔”,文中的講解內(nèi)容簡單清晰,易于學(xué)習(xí)與理解,下面請大家跟著小編的思路慢慢深入,一起來研究和學(xué)習(xí)“如何使用screw一鍵生成數(shù)據(jù)庫文檔”吧!

一. screw的配置
  1. 配置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>數(shù)據(jù)庫文檔生成</description>
          <!--版本 -->
          <version>1.0.0</version>
          <!--標(biāo)題 -->
          <title>數(shù)據(jù)庫文檔</title>
        </configuration>
        <executions>
          <execution>
            <phase>compile</phase>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
  1. 配置數(shù)據(jù)源
    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插件運(yùn)行screw
  1. IDEA中運(yùn)行

  2. 如何使用screw一鍵生成數(shù)據(jù)庫文檔

  3. Eclipse中運(yùn)行

  • 處理POM配置文件中的錯(cuò)誤(也可以不管這個(gè)錯(cuò)誤,直接運(yùn)行

  • 如何使用screw一鍵生成數(shù)據(jù)庫文檔


  • 如何使用screw一鍵生成數(shù)據(jù)庫文檔


  • 如何使用screw一鍵生成數(shù)據(jù)庫文檔


  • 運(yùn)行

  • 如何使用screw一鍵生成數(shù)據(jù)庫文檔


  • 如何使用screw一鍵生成數(shù)據(jù)庫文檔

  • 在Goals中輸入:screw:run

三. 生成數(shù)據(jù)庫各表的設(shè)計(jì)文檔

如何使用screw一鍵生成數(shù)據(jù)庫文檔

感謝各位的閱讀,以上就是“如何使用screw一鍵生成數(shù)據(jù)庫文檔”的內(nèi)容了,經(jīng)過本文的學(xué)習(xí)后,相信大家對如何使用screw一鍵生成數(shù)據(jù)庫文檔這一問題有了更深刻的體會(huì),具體使用情況還需要大家實(shí)踐驗(yàn)證。這里是億速云,小編將為大家推送更多相關(guān)知識(shí)點(diǎn)的文章,歡迎關(guān)注!

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI