基于spring-boot-maven-plugin插件打包lib文件外置的方法(layout模式為ZIP模式)
本篇文章為自己親自實踐所得,項目是基于 spring boot 的多模塊 Maven 項目, 依賴錯綜復雜。參考網(wǎng)上千篇一律的復制文章躺了不少坑。
整體感覺下來,Maven就是一把利劍,理解的到位,能化腐朽為神奇,基礎(chǔ)不牢,費心費神。為了減小本文篇幅,基礎(chǔ)知識一定要參考apache maven 官網(wǎng)學習
為了少走彎路,基礎(chǔ)插件知識請進入官網(wǎng)學習:https://maven.apache.org/plugins/index.html
正文
乍一看,Maven 可能看起來有很多東西,但簡而言之,maven是將項目工程模式應(yīng)用于項目構(gòu)建的基礎(chǔ)架構(gòu)。
講人話就是:Maven是一個插件執(zhí)行框架;所有工作都由插件完成。同時 Maven 基于構(gòu)建生命周期的核心概念,明確定義了構(gòu)建和分發(fā)特定工件(項目)的過程。
本次用到的插件
非官方插件
插件 | 作用 |
---|---|
spring-boot-maven-plugin | spring boot官方打包插件,本次使用其 layout 為 ZIP 的模式進行打包 |
官方插件:
插件 | 作用 |
---|---|
spring-boot-maven-plugin | spring boot官方打包插件,本次使用其 layout 為 ZIP 的模式進行打包 |
官方插件:
插件 | 作用 |
---|---|
maven-resources-plugin | 資源文件處理插件,配置文件中的 @…@ 包圍的變量 |
maven-dependency-plugin | 依賴操作(復制、解包)和分析。本次用來將依賴的 jar 包移到lib文件夾中 |
maven-assembly-plugin | 構(gòu)建源和/或二進制文件的程序包(分發(fā))。比如打包成 zip 文件 |
maven插件有著自己的一套命名規(guī)范。官方插件命名的格式為 [maven-xxx
-plugin],非官方的插件命名為 [xxx
-maven-plugin] 。是不是覺得很眼熟,沒錯,spring boot starter 的命名也有類似的規(guī)范。
如下幾個插件可以看其名字就能區(qū)分是maven官方的還是非官方的:spring-boot-maven-plugin、maven-surefire-plugin、maven-resources-plugin
官方插件可以詳見官方地址:https://maven.apache.org/plugins/index.html
小步慢跑實現(xiàn):jar包瘦身,lib包外置
千萬不要想著一步實現(xiàn)lib包外置,我們的目標是將lib包外置,網(wǎng)上一堆文章直接貼整體配置文檔,注釋和當時什么地方有坑言之較少,所以我們還是得按自己的想法進行嘗試,確保問題控制在自己的掌控范圍之內(nèi)。
目標: 實現(xiàn)lib外置
準備工作:
- 打包fast jar ,因為使用的是 spring boot項目,使用官方提供的插件進行打包。
- 使用 spring-boot-maven-plugin 插件,layout加載方式改為 ZIP 模式可以實現(xiàn)。(因為該插件是在maven-jar-plugin 插件之后執(zhí)行)
使用官方的 maven-jar-plugin(我嘗試過但是依賴導入會有問題總是報錯“java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy”類型的錯誤,因為MANIFEST.MF文件中Class-Path參數(shù)不能個性化排除業(yè)務(wù)jar。所以我調(diào)試無果之后僅使用的是spring boot的官方插件)
- 有哪些方法可以實現(xiàn) fast jar中的lib文件中的jar包移到j(luò)ar外部的文件夾中
需要使用 maven-dependency-plugin 插件 - fast jar的內(nèi)部結(jié)構(gòu)了解,了解打包插件最終修改的是哪些參數(shù)。
MANIFEST.MF
文件及其參數(shù)了解, BOOT-INF文件夾作用 - pom文件中
build
配置的標簽有哪些自己不知道的,比如 configuration 參數(shù)如何查詢(官方文檔) - spring-boot-maven-plugin 插件能實現(xiàn)哪些功能,phase、goals
- 經(jīng)了解spring-boot-maven-plugin 實現(xiàn)lib 外置需要,切換打包方式
<layout>ZIP</layout>
啟用-Dloader.path=lib/
- 使用 includes 標簽可以將匹配的 jar 保留在原來的BOOT-INF/lib中
- 經(jīng)了解spring-boot-maven-plugin 實現(xiàn)lib 外置需要,切換打包方式
實踐的基本步驟
- 切換layout 為 ZIP模式,確保項目啟動成功
- 先將lib包全部外置,確保項目再次啟動成功。(需要使用-Dloader.path=lib/ 啟動參數(shù))
- 過濾業(yè)務(wù)相關(guān)的jar,打包到 fast jar 中,啟動肯定是要報錯,錯誤來源與外部lib的jar包
- 配置maven-dependency-plugin 排除業(yè)務(wù)jar放入外置lib文件夾中。
先看成果最終信息
啟動的時候需要增加 -Dloader.path=lib/
參數(shù),以下只是一個簡單的啟動命令:
java -jar -Dloader.path=lib/ gd_mbs_zfxn.jar
文件結(jié)構(gòu),jar包因為了便于展示結(jié)構(gòu),已解壓成文件
. 本文件夾
├─gd_mbs_zfxn.jar## jar 包
│ ├─BOOT-INF
│ │ ├─classes
│ │ │ ├─com
│ │ │ │ └─****## 省略詳細信息,主要包含的啟動類的class文件,對應(yīng)MANIFEST.MF 文件的 Start-Class項
│ │ │ ├─config## 存放配置文件 yml,xml 等等
│ │ │ ├─templates
│ │ │ │ └─license
│ │ │ └─xml
│ │ └─lib## 還有項目依賴的業(yè)務(wù) jar 包
│ ├─META-INF
│ │ └─maven
│ │ └─com.bdsoft.framework.gd
│ │ └─leea-app
│ └─org
│ └─springframework
│ └─boot
│ └─loader
│ ├─archive
│ ├─data
│ ├─jar
│ └─util
└─lib
1.所得jar包中: MANIFEST.MF 文件內(nèi)容如下,請注意 Main-Class是PropertiesLauncher
,這個是pom中 spring-boot-maven-plugin 插件配置 <layout>ZIP</layout>
的結(jié)果。
Manifest-Version: 1.0 Implementation-Title: APP啟動配置 Implementation-Version: 1.0.0.0 Start-Class: com.bdsoft.BDPWebApplication Spring-Boot-Classes: BOOT-INF/classes/ Spring-Boot-Lib: BOOT-INF/lib/ Build-Jdk-Spec: 1.8 Spring-Boot-Version: 2.2.7.RELEASE Created-By: Maven Jar Plugin 3.2.0 Main-Class: org.springframework.boot.loader.PropertiesLauncher
2.配置文件不外置,仍然放在jar的原來位置 BOOT-INF/classes 文件下面
這個需要
3.業(yè)務(wù)jar仍然放在jar內(nèi)部的 BOOT-INF/lib 文件下.
4.非業(yè)務(wù)的其他依賴jar包(不包含3中的三個業(yè)務(wù)jar)全部放置在啟動jar(fast jar)同級的 lib文件夾下面。
全部 pom配置
<build> <finalName>gd_mbs_zfxn</finalName> <!-- mavne打包動態(tài)修改替換配置文件中的占位符 --> <resources> <resource> <directory>${basedir}/src/main/resources</directory> <!-- 處理其中的可替換參數(shù)(@..@符合標注的變量) --> <filtering>true</filtering> </resource> <!-- 可以配置引入哪些配置文件includes或排除哪些文件excludes --> </resources> <plugins> <!-- spring boot的打包插件進行打包成 fastjar --> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <version>2.2.7.RELEASE</version> <configuration> <!-- --> <layout>ZIP</layout> <includeSystemScope>true</includeSystemScope> <mainClass>com.bdsoft.BDPWebApplication</mainClass> <includes> <!-- 項目啟動jar包中保留依賴包 --> <include> <groupId>com.bdsoft.framework.gd</groupId> <artifactId>leea-sym</artifactId> </include> <include> <groupId>com.bdsoft.framework.gd</groupId> <artifactId>leea-efficiency</artifactId> </include> <include> <groupId>com.googlecode.aviator</groupId> <artifactId>leea-aviator</artifactId> </include> </includes> </configuration> <executions> <execution> <goals> <!-- 這個是默認 goal,在 mvn package 執(zhí)行之后,這個命令再次打包生成可執(zhí)行的 jar,同時將 mvn package 生成的 jar 重命名為 *.origin --> <goal>repackage</goal> </goals> </execution> </executions> </plugin> <!--打包時跳過測試代碼--> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.22.2</version> <configuration> <skip>true</skip> </configuration> </plugin> <!-- 配置文件處理插件 --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> <version>3.1.0</version> <configuration> <encoding>utf-8</encoding> <!-- 是否使用默認占位符@@ --> <useDefaultDelimiters>true</useDefaultDelimiters> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <version>3.1.0</version> <executions> <!--導出所有的 jar 包--> <execution> <id>pra1</id> <!-- (打包階段):在實際打包中,執(zhí)行任何的必要的操作。 --> <phase>package</phase> <goals> <goal>copy-dependencies</goal> </goals> <configuration> <outputDirectory>${project.build.directory}/lib</outputDirectory> <stripVersion>false</stripVersion> <!-- 不包含哪些jar包 --> <excludeGroupIds> <!-- 只排除業(yè)務(wù)模塊相關(guān)的jar包,多個用英文逗號分割--> com.bdsoft.framework.gd, com.googlecode.aviator </excludeGroupIds> </configuration> </execution> </executions> </plugin> <!-- 打包zip插件 --> <plugin> <artifactId>maven-assembly-plugin</artifactId> <version>3.4.2</version> <configuration> <descriptors> <descriptor>src/main/assembly/assembly.xml</descriptor> </descriptors> </configuration> <executions> <execution> <id>make-assembly</id> <phase>package</phase> <goals> <goal>single</goal> </goals> </execution> </executions> </plugin> </plugins> </build>
maven-assembly-plugin 插件對應(yīng)的 assembly.xml 內(nèi)容如下
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.1.1 https://maven.apache.org/xsd/assembly-2.1.1.xsd"> <!-- 可自定義,這里指定的是項目環(huán)境 --> <!-- gd_mbs_zfxn-dev-1.0.0.0.tar.gz --> <id>${profiles.active}-${project.version}</id> <!-- 打包的類型,如果有N個,將會打N個類型的包 --> <formats> <format>tar.gz</format> <format>zip</format> </formats> <!-- 默認為true。指定打的包是否包含打包層目錄(比如finalName是prefix,當值為true,所有文件被放在包內(nèi)的prefix目錄下, 否則直接放在包的根目錄下。finalName標簽在pom文件中注冊插件里面的configuration標簽下 --> <includeBaseDirectory>false</includeBaseDirectory> <!-- 指定要包含在程序集中的文件組。通過提供一個或多個 <fileSet> 子元素來指定文件集。 --> <fileSets> <!-- fileMode,還有一個 directoryMode 與 UNIX 權(quán)限類似,設(shè)置所包含文件的文件模式。這是一個八進制值。格式:(User)(Group)(Other) 其中每個組件是 Read = 4、Write = 2 和 Execute = 1 的總和。例如,值 0644 轉(zhuǎn)換為 User read-write、Group and Other read-only . 默認值為 0644 0755->即用戶具有讀/寫/執(zhí)行權(quán)限,組用戶和其它用戶具有讀寫權(quán)限; 0644->即用戶具有讀寫權(quán)限,組用戶和其它用戶具有只讀權(quán)限; --> <!-- 將src/bin目錄下的所有文件輸出到打包后的bin目錄中 --> <fileSet> <directory>${basedir}/src/bin</directory> <outputDirectory>bin</outputDirectory> <fileMode>0755</fileMode> <includes> <include>**.sh</include> <include>**.bat</include> </includes> </fileSet> <!-- 指定輸出target/classes中的配置文件到config目錄中 --> <fileSet> <directory>${project.build.directory}/classes</directory> <outputDirectory>config</outputDirectory> <fileMode>0644</fileMode> <includes> <!-- 啟動必須的的 bootstrap文件 --> <include>**/bootstrap.yml</include> <!-- 主要配置文件、system配置文件和對應(yīng)環(huán)境${profiles.active}的文件 --> <include>**/application.yml</include> <include>**/application-system.yml</include> <include>**/application-${profiles.active}.yml</include> <!-- mybatis文件 暫時冗余 --> <include>mapper/**/*.xml</include> <!-- 靜態(tài)文件 暫時冗余 --> <include>static/**</include> <!-- 模板文件 --> <include>templates/**</include> <!-- 全部的xml文件 --> <include>**/*.xml</include> <!-- 全部的配置文件 --> <include>**/*.properties</include> <include>**/*.txt</include> </includes> </fileSet> <!-- 將第三方依賴打包到lib目錄中 --> <fileSet> <directory>${basedir}/target/lib</directory> <outputDirectory>lib</outputDirectory> <fileMode>0755</fileMode> </fileSet> <!-- 將項目啟動jar打包到boot目錄中,target文件夾下 --> <fileSet> <directory>${project.build.directory}</directory> <outputDirectory></outputDirectory> <fileMode>0755</fileMode> <includes> <include>${project.build.finalName}.jar</include> </includes> </fileSet> <!-- 包含根目錄下的文件 --> <fileSet> <directory>${basedir}</directory> <includes> <include>*.md</include> </includes> </fileSet> </fileSets> </assembly>
上的${profiles.active}
變量來源于下面的profiles設(shè)置,如果不需要動態(tài)配置文件,可以忽略將上面相關(guān)變量${profiles.active}
刪除。
<profiles> <profile> <!-- 生產(chǎn)環(huán)境 --> <id>pross</id> <properties> <!-- 激活的環(huán)境 --> <profiles.active>pro</profiles.active> <!-- 其他參數(shù)的配置,編譯打包的時候替換資源文件中的 @testparam@ 變量 --> <testparam>xxx</testparam> </properties> </profile> <profile> <!-- 預發(fā)布環(huán)境 --> <id>prepro</id> <properties> <!-- 激活的環(huán)境文件 --> <profiles.active>prepro</profiles.active> <!-- 其他參數(shù)的配置,編譯打包的時候替換資源文件中的 @testparam@ 變量 --> <testparam>xxx</testparam> </properties> </profile> <profile> <!-- 本地開發(fā)環(huán)境 --> <id>dev</id> <properties> <!-- 激活的環(huán)境文件 --> <profiles.active>dev</profiles.active> <!-- 其他參數(shù)的配置,編譯打包的時候替換資源文件中的 @testparam@ 變量 --> <testparam>xxx</testparam> </properties> <activation> <!-- 默認選中本地環(huán)境 --> <activeByDefault>true</activeByDefault> </activation> </profile> <profile> <!-- 測試環(huán)境 --> <id>test</id> <properties> <!-- 激活的環(huán)境文件 --> <profiles.active>test</profiles.active> <!-- 其他參數(shù)的配置,編譯打包的時候替換資源文件中的 @testparam@ 變量 --> <testparam>xxx</testparam> </properties> </profile> </profiles>
業(yè)務(wù) jar 的位置操作
想要實現(xiàn)業(yè)務(wù) jar 仍然放在jar內(nèi)部的 BOOT-INF/lib 文件下,其他依賴 jar 放入 lib文件夾中,需要兩個插件配合。maven-dependency-plugin 和 spring-boot-maven-plugin 插件在 package 階段根據(jù)各自的匹配策略將 業(yè)務(wù)jar 排除和匹配放入
核心思路就是:
- 我們想實現(xiàn)的目的是什么,這個目的處在maven生命周期的什么階段,對應(yīng)使用什么插件(<plugin>)
- 我們的目的需要在什么觸發(fā)事件中執(zhí)行(<execution><phase>)
- 我們的目的需要什么組件去實現(xiàn),是測試組件還是打包組件還是依賴組件。將我們的想法分解成符合maven的工程概念,并找到其中合適的組件,配置它提供的<goals><goal>(對應(yīng)Mojo)目標功能(dependency)實現(xiàn)我們的目的。讓它操作基于我們提供的匹配原則(includes符合或excludes排除)符合的文件<configuration>
核心注意點:
- jar 包是在package階段,我們需要將依賴jar導出到lib包中,可以使用為了便于理解我都采用的是 package階段
- spring-boot-maven-plugin 插件中僅放行 業(yè)務(wù)jar 打入fast jar,請看
<include>
標簽,因為默認 goal 是repackage,對應(yīng)的是mvn package,maven-dependency-plugin 插件也使用 package 階段,該插件使用詳見:https://docs.spring.io/spring-boot/docs/2.2.1.RELEASE/maven-plugin/
<includes> <!-- 項目啟動jar包中保留依賴包 --> <include> <groupId>com.bdsoft.framework.gd</groupId> <artifactId>leea-sym</artifactId> </include> <include> <groupId>com.bdsoft.framework.gd</groupId> <artifactId>leea-efficiency</artifactId> </include> <include> <groupId>com.googlecode.aviator</groupId> <artifactId>leea-aviator</artifactId> </include> </includes>
3.maven-dependency-plugin插件中不能再將 業(yè)務(wù)jar 輸出到外置 lib 文件夾,所以需要排除相應(yīng)的業(yè)務(wù)jar,不然會在啟動的時候報創(chuàng)建bean失敗的錯誤,詳見 excludeGroupIds
標簽,記得使用 英文逗號分割,該插件使用詳見:https://maven.apache.org/plugins/maven-dependency-plugin/,排除依賴相關(guān)說明詳見copy-dependencies的文檔:https://maven.apache.org/plugins/maven-dependency-plugin/copy-dependencies-mojo.html
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <version>3.1.0</version> <executions> <!--導出所有的 jar 包--> <execution> <id>pra1</id> <!-- (打包階段):在實際打包中,執(zhí)行任何的必要的操作。 --> <phase>package</phase> <goals> <goal>copy-dependencies</goal> </goals> <configuration> <outputDirectory>${project.build.directory}/lib</outputDirectory> <stripVersion>false</stripVersion> <!-- 不包含哪些jar包 --> <excludeGroupIds> <!-- 只排除業(yè)務(wù)模塊相關(guān)的jar包,多個用英文逗號分割--> com.bdsoft.framework.gd, com.googlecode.aviator </excludeGroupIds> </configuration> </execution> </executions> </plugin>
maven的 package 打包時的詳細信息 插件的執(zhí)行順序
maven-resources-plugin resources (default-resources)
maven-compiler-plugin compile (default-compile)
maven-resources-plugin testResources (default-testResources)
maven-compiler-plugin testCompile (default-testCompile)
maven-surefire-plugin test (default-test)
maven-jar-plugin jar (default-jar)
spring-boot-maven-plugin repackage (repackage)
spring-boot-maven-plugin repackage (default)
maven-dependency-plugin copy-dependencies (pra1) 【pra1 是execution 定義的id】
maven-assembly-plugin single (make-assembly)
詳細日志如下:
[INFO] ------------------< com.bdsoft.framework.gd:leea-app >------------------ [INFO] Building APP啟動配置 1.0.0.0 [5/6] [INFO] --------------------------------[ jar ]--------------------------------- .... [INFO] [INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ leea-app --- [INFO] Using 'utf-8' encoding to copy filtered resources. [INFO] Copying 16 resources [INFO] [INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ leea-app --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 13 source files to D:\work\workspaces\workspace-af\xxxxxxxxxxx\gd_mbs_zfxn\xxxx\leea-app\target\classes [INFO] /D:/work/workspaces/workspace-af/xxxxxxxxxxx/gd_mbs_zfxn/xxxx/leea-app/src/main/java/com/bdsoft/config/system/GlobalCorsConfig.java: 某些輸入文件使用或覆蓋了已過時的 API。 [INFO] /D:/work/workspaces/workspace-af/xxxxxxxxxxx/gd_mbs_zfxn/xxxx/leea-app/src/main/java/com/bdsoft/config/system/GlobalCorsConfig.java: 有關(guān)詳細信息, 請使用 -Xlint:deprecation 重新編譯。 [INFO] [INFO] --- maven-resources-plugin:3.1.0:testResources (default-testResources) @ leea-app --- [INFO] Using 'utf-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory D:\work\workspaces\workspace-af\xxxxxxxxxxx\gd_mbs_zfxn\xxxx\leea-app\src\test\resources [INFO] [INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ leea-app --- [INFO] No sources to compile [INFO] [INFO] --- maven-surefire-plugin:2.22.2:test (default-test) @ leea-app --- [INFO] Tests are skipped. [INFO] [INFO] --- maven-jar-plugin:3.2.0:jar (default-jar) @ leea-app --- [INFO] Building jar: D:\work\workspaces\workspace-af\xxxxxxxxxxx\gd_mbs_zfxn\xxxx\leea-app\target\gd_mbs_zfxn.jar [INFO] [INFO] --- spring-boot-maven-plugin:2.2.7.RELEASE:repackage (repackage) @ leea-app --- [INFO] Layout: ZIP [INFO] Replacing main artifact with repackaged archive [INFO] [INFO] --- spring-boot-maven-plugin:2.2.7.RELEASE:repackage (default) @ leea-app --- [INFO] Layout: ZIP [INFO] Replacing main artifact with repackaged archive [INFO] [INFO] --- maven-dependency-plugin:3.1.0:copy-dependencies (pra1) @ leea-app --- [INFO] Copying tomcat-embed-websocket-9.0.37.jar to D:\work\workspaces\workspace-af\xxxxxxxxxxx\gd_mbs_zfxn\xxxx\leea-app\target\lib\tomcat-embed-websocket-9.0.37.jar [INFO] Copying lombok-1.18.12.jar to D:\work\workspaces\workspace-af\xxxxxxxxxxx\gd_mbs_zfxn\xxxx\leea-app\target\lib\lombok-1.18.12.jar .... [INFO] [INFO] --- maven-assembly-plugin:3.4.2:single (make-assembly) @ leea-app --- [INFO] Reading assembly descriptor: src/main/assembly/assembly.xml [INFO] Building tar: D:\work\workspaces\workspace-af\xxxxxxxxxxx\gd_mbs_zfxn\xxxx\leea-app\target\gd_mbs_zfxn-dev-1.0.0.0.tar.gz [INFO] Building zip: D:\work\workspaces\workspace-af\xxxxxxxxxxx\gd_mbs_zfxn\xxxx\leea-app\target\gd_mbs_zfxn-dev-1.0.0.0.zip [INFO]
總結(jié)
不要盲目相信網(wǎng)上 各種拷貝粘貼文,有問題第一時間應(yīng)該去閱讀一下官方的文檔,畢竟官方才是理解最深的那位,文檔也是最淺顯易懂的。
到此這篇關(guān)于基于spring-boot-maven-plugin插件打包lib文件外置(layout模式為ZIP模式)的文章就介紹到這了,更多相關(guān)spring-boot-maven-plugin插件打包內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
JDK動態(tài)代理之WeakCache緩存的實現(xiàn)機制
這篇文章主要介紹了JDK動態(tài)代理之WeakCache緩存的實現(xiàn)機制2018-02-02java配置多個過濾器優(yōu)先級以及幾個常用過濾器操作
這篇文章主要介紹了java配置多個過濾器優(yōu)先級以及幾個常用過濾器的操作,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教2021-07-07簡單了解springboot中的配置文件相關(guān)知識
這篇文章主要介紹了簡單了解springboot中的配置文件相關(guān)知識,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友可以參考下2019-11-11springboot+camunda實現(xiàn)工作流的流程分析
Camunda是基于Java語言,支持BPMN標準的工作流和流程自動化框架,并且還支持CMMN規(guī)范,DMN規(guī)范,本文給大家介紹springboot+camunda實現(xiàn)工作流的流程分析,感興趣的朋友一起看看吧2021-12-12Java Mybatis框架多表操作與注解開發(fā)詳解分析
MyBatis 是一款優(yōu)秀的持久層框架,它支持自定義 SQL、存儲過程以及高級映射。MyBatis 免除了幾乎所有的 JDBC 代碼以及設(shè)置參數(shù)和獲取結(jié)果集的工作。MyBatis 可以通過簡單的 XML 或注解來配置和映射原始類型、接口和 Java POJO為數(shù)據(jù)庫中的記錄2021-10-10