<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ## 基礎架構搭建 在這一章節我們正式開始框架的搭建 ## Maven父模塊搭建 為了方便后面我們隨意拓展采用Maven多模塊搭建 首先我們使用IDEA創建一個名稱為`pre`的 Maven模塊,該模塊為整個工程的服務模塊,用于聚合各個子模塊。 然后打開IDEA,點擊Create New Project新建一個Maven項目,Project SDK選擇JDK 1.8 ![file](https://pic.52lhd.com/blog/article/20191229152617962.png) 點擊Next,如下圖所示填寫Name、路徑、GroupId和ArtifactId: ![file](https://pic.52lhd.com/blog/article/20191229153421236.png) 點擊Finish完成創建。創建好后,項目如下所示: ![file](https://pic.52lhd.com/blog/article/20191229153606200.png) 因為pre模塊是項目的父模塊,僅用于聚合子模塊,所以我們可以把src目錄下的內容全部刪了,只保留pom.xml(pre.iml為IDEA文件,不能刪哦),然后修改pom.xml,引入Spring Boot ``` <?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>com.xd.pre</groupId> <artifactId>pre</artifactId> <version>1.0-SNAPSHOT</version> <packaging>pom</packaging> <name>pre</name> <description>pre:Spring Boot,Spring Security 權限管理系統</description> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.2.2.RELEASE</version> <relativePath/> </parent> </project> ``` 上面的pom配置中,我們指定了packaging為pom,表示這是一個純聚合模塊,無需打包為jar或者war;name指定為pre;引入了Spring Boot 2.2.2.RELEASE 至此,父模塊搭建完畢,接下來開始搭建通用模塊。 ### 通用模塊搭建 通用模塊主要用于定義一些系統通用的實體類,工具類。 點擊pre項目右擊-> New -> Module...,新建一個Maven模塊,Module SDK選擇JDK 1.8: ![file](https://pic.52lhd.com/blog/article/20191229154128433.png) ArtifactId填pre-common,然后點擊Next: ![file](https://pic.52lhd.com/blog/article/20191229154216819.png) 填寫內容如上圖所示(注意pre-common位于pre目錄下,它們在目錄結構上是父級的關系),點擊Finish完成創建。創建好后,項目結構如下所示: ![file](https://pic.52lhd.com/blog/article/20191229154455626.png) 這時候我們查看pre的pom文件,會發現它新增了如下內容 ``` <modules> <module>pre-common</module> </modules> ``` 稍后我們往pre-common模塊的pom里添加一些后續要用到的工具類等 我們現在可以往pre的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 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.xd.pre</groupId> <artifactId>pre</artifactId> <version>1.0-SNAPSHOT</version> <modules> <module>pre-common</module> </modules> <packaging>pom</packaging> <name>pre</name> <description>pre:Spring Boot,Spring Security 權限管理系統</description> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.2.2.RELEASE</version> <relativePath/> </parent> <properties> <java.version>1.8</java.version> <velocity.version>2.1</velocity.version> <hutool.version>4.5.6</hutool.version> <fastjson.version>1.2.58</fastjson.version> </properties> <dependencies> <!--web--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <exclusions> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> </exclusion> </exclusions> </dependency> <!--undertow容器--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-undertow</artifactId> </dependency> <!--mysql--> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <scope>runtime</scope> </dependency> <!--lombok--> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <optional>true</optional> </dependency> <!--hutool工具--> <dependency> <groupId>cn.hutool</groupId> <artifactId>hutool-all</artifactId> <version>${hutool.version}</version> </dependency> <!--json解析--> <dependency> <groupId>com.alibaba</groupId> <artifactId>fastjson</artifactId> <version>${fastjson.version}</version> </dependency> </dependencies> </project> ``` lombok的使用需要安裝相關插件(lombok可以通過注解自動生成get,set等方法,不懂的同學可以自行百度lombok)打開IDEA的插件,然后輸入 ![file](https://pic.52lhd.com/blog/article/20191229155104618.png) 至此,通用模塊和基礎架構搭建完畢了,接下來開始搭建RBAC系統模塊
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看