Maven配置文件settings.xml的實(shí)現(xiàn)
Maven是一個(gè)用于構(gòu)建和管理Java項(xiàng)目的強(qiáng)大工具,它依賴于設(shè)置文件來(lái)配置和管理其行為。其中最重要的之一便是settings.xml文件。settings.xml文件是Maven的配置文件之一,用于定義Maven的全局設(shè)置、倉(cāng)庫(kù)、代理、插件、配置和個(gè)人用戶信息等。這個(gè)文件通常存儲(chǔ)在Maven安裝目錄的conf文件夾下。
讓我們深入了解settings.xml文件的結(jié)構(gòu)和功能。
setting文件位置
Maven使用setting.xml文件來(lái)配置它本身的行為。這個(gè)文件通常位于Maven的conf目錄下。
- 在Windows系統(tǒng)中,它的默認(rèn)位置**%USER_HOME%.m2\settings.xml**
- 在Linux或Mac OS X中,它的默認(rèn)位置是**~/.m2/settings.xml**。
maven多倉(cāng)庫(kù)查找依賴的順序大致如下:
1.本地倉(cāng)庫(kù)
2.項(xiàng)目profile倉(cāng)庫(kù),通過(guò) pom.xml 中的 project.profiles.profile.repositories.repository 配置
3.項(xiàng)目倉(cāng)庫(kù),通過(guò) pom.xml 中的 project.repositories.repository 配置
4.全局profile倉(cāng)庫(kù),通過(guò) settings.xml 中的 settings.repositories.repository 配置
5.鏡像倉(cāng)庫(kù),通過(guò) sttings.xml 中的 settings.mirrors.mirror 配置
6.中央倉(cāng)庫(kù),這是默認(rèn)的倉(cāng)庫(kù)
基本配置選項(xiàng)
基本結(jié)構(gòu)
settings.xml文件使用XML格式,其結(jié)構(gòu)包含了Maven的全局設(shè)置以及個(gè)人或項(xiàng)目特定的配置。下面是一個(gè)典型的settings.xml文件的簡(jiǎn)化版本:
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<!-- 本地倉(cāng)庫(kù)的位置 -->
<localRepository>D:\IDEA\my-idea-repository</localRepository>
<!-- 鏡像設(shè)置,用于指定中央倉(cāng)庫(kù)的鏡像,以提高依賴項(xiàng)下載的速度 -->
<mirrors>
<!-- 阿里私服 -->
<mirror>
<id>alimaven</id>
<mirrorOf>central</mirrorOf>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
</mirror>
<!-- 中央倉(cāng)庫(kù)1 -->
<mirror>
<id>repo1</id>
<mirrorOf>central</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://repo1.maven.org/maven2/</url>
</mirror>
<!-- 中央倉(cāng)庫(kù)2 -->
<mirror>
<id>repo2</id>
<mirrorOf>central</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://repo2.maven.org/maven2/</url>
</mirror>
</mirrors>
</settings>
localRepository(本地倉(cāng)庫(kù)設(shè)置)
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">
...
<!--本地倉(cāng)庫(kù)。該值表示構(gòu)建系統(tǒng)本地倉(cāng)庫(kù)的路徑。其默認(rèn)值為${user.home}/.m2/repository。 -->
<localRepository>usr/local/maven</localRepository>
...
</settings>
mirrors(鏡像設(shè)置)
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">
...
<!--為倉(cāng)庫(kù)列表配置的下載鏡像列表。用于指定中央倉(cāng)庫(kù)的鏡像,以提高依賴項(xiàng)下載的速度 -->
<mirrors>
<!--
| 【mirro 匹配順序】:
| 多個(gè) mirror 優(yōu)先級(jí) 按照 id字母順序進(jìn)行排列(即與編寫(xiě)的順序無(wú)關(guān))
| 在第一個(gè) mirror 找不到 artifact, 不會(huì)繼續(xù)超找下一個(gè)鏡像。
| 只有當(dāng) mirror 無(wú)法鏈接的時(shí)候, 才會(huì)嘗試鏈接下一個(gè)鏡像, 類似容災(zāi)備份。
|-->
<mirror>
<!-- 該鏡像的唯一標(biāo)識(shí)符, id用來(lái)區(qū)分不同的 mirror 元素, 同時(shí)會(huì)套用使用 server 中 id 相同授權(quán)配置鏈接到鏡像 -->
<id>aliyun</id>
<!-- 鏡像名稱, 無(wú)特殊作用, 可視為簡(jiǎn)述 -->
<name>sjtug maven proxy</name>
<!-- 鏡像地址 -->
<url>https://mirrors.sjtug.sjtu.edu.cn/maven-central/</url>
<!-- mirrorOf表示被鏡像的服務(wù)器的id,
必須與 repository 節(jié)點(diǎn)設(shè)置的 ID 一致。但是 This must not match the mirror id
| mirrorOf 的配置語(yǔ)法:
| * = 匹配所有遠(yuǎn)程倉(cāng)庫(kù)。 這樣所有 pom 中定義的倉(cāng)庫(kù)都不生效
| external:* = 匹配除 localhost、使用 file:// 協(xié)議外的所有遠(yuǎn)程倉(cāng)庫(kù)
| repo1,repo2 = 匹配倉(cāng)庫(kù) repo1 和 repo2
| *,!repo1 = 匹配所有遠(yuǎn)程倉(cāng)庫(kù), repo1 除外
|-->
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
...
</settings>
- id, name:鏡像的唯一標(biāo)識(shí)和對(duì)用戶友好的名稱。id用于區(qū)分鏡像元素,并在連接到鏡像時(shí)從節(jié)中挑選相應(yīng)的憑據(jù)。
- url:這個(gè)鏡像的基本url。 構(gòu)建系統(tǒng)將使用此URL連接到存儲(chǔ)庫(kù),而不是默認(rèn)的存儲(chǔ)庫(kù)URL。
- mirrorOf:作為鏡像的存儲(chǔ)庫(kù)id。 例如,要指向Maven中央存儲(chǔ)庫(kù)(https://repo.maven.apache.org/maven2/)的一個(gè)鏡像,請(qǐng)將此元素設(shè)置為central。這必須和中央倉(cāng)庫(kù)的id完全一致。
servers(服務(wù)器)
用于下載和部署的存儲(chǔ)庫(kù)由項(xiàng)目的pom.xml 的repositories和distributionManagement元素定義。
但是,用戶名和密碼等某些身份設(shè)置不應(yīng)該與pom.xml一起發(fā)布。
這類信息應(yīng)該存在于構(gòu)建服務(wù)器的settings.xml中。
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">
...
<!-- 進(jìn)行遠(yuǎn)程服務(wù)器訪問(wèn)時(shí)所需的授權(quán)配置信息。通過(guò)系統(tǒng)唯一的 server-id 進(jìn)行唯一關(guān)聯(lián) -->
<servers>
<server>
<!-- 這是 server 的 id, 該 id 與 distributionManagement 中 repository 元素的id 相匹配 -->
<id>server_id</id>
<!-- 鑒權(quán)用戶名 -->
<username>auth_username</username>
<!-- 鑒權(quán)密碼 -->
<password>auth_pwd</password>
<!-- 鑒權(quán)時(shí)使用的私鑰位置。和前兩個(gè)元素類似, 私鑰位置和私鑰密碼指定了一個(gè)私鑰的路徑(默認(rèn)是/home/hudson/.ssh/id_dsa)以及如果需要的話, 一個(gè)密鑰 -->
<privateKey>path/to/private_key</privateKey>
<!-- 鑒權(quán)時(shí)使用的私鑰密碼, 非必要, 非必要時(shí)留空 -->
<passphrase>some_passphrase</passphrase>
<!--
| 文件被創(chuàng)建時(shí)的權(quán)限。如果在部署的時(shí)候會(huì)創(chuàng)建一個(gè)倉(cāng)庫(kù)文件或者目錄, 這時(shí)候就可以使用權(quán)限(permission)
| 這兩個(gè)元素合法的值是一個(gè)三位數(shù)字, 其對(duì)應(yīng)了unix文件系統(tǒng)的權(quán)限, 如664, 或者775
|-->
<filePermissions>664</filePermissions>
<!-- 目錄被創(chuàng)建時(shí)的權(quán)限 -->
<directoryPermissions>775</directoryPermissions>
<!-- 傳輸層額外的配置項(xiàng) -->
<configuration></configuration>
</server>
</servers>
...
</settings>
- id:這是服務(wù)器的ID(不是要作為用戶登錄的ID),用來(lái)匹配Maven試圖連接到的存儲(chǔ)庫(kù)/鏡像的id元素。
- username, password:這些元素以一對(duì)的形式出現(xiàn),表示向該服務(wù)器進(jìn)行身份驗(yàn)證所需的登錄名和密碼。
- privateKey, passphrase:與前面兩個(gè)元素一樣,這對(duì)元素指定私鑰(默認(rèn)為${user.home}/.ssh/id_dsa)的路徑和一個(gè)passphrase(如果需要的話)。 passphrase和password元素將來(lái)可能會(huì)外部化,但目前它們必須在settings.xml文件中以明文方式設(shè)置。
- filePermissions、directoryPermissions:文件、目錄被創(chuàng)建時(shí)的權(quán)限。如果在部署的時(shí)候會(huì)創(chuàng)建一個(gè)倉(cāng)庫(kù)文件或者目錄,這時(shí)候就可以使用權(quán)限(permission)。這兩個(gè)元素合法的值是一個(gè)三位數(shù)字,其對(duì)應(yīng)了unix文件系統(tǒng)的權(quán)限,如664,或者775。
注意:如果使用私鑰登錄服務(wù)器,請(qǐng)確保忽略元素。 否則,該鍵將被忽略。
Profiles(配置文件)
作用:根據(jù)環(huán)境參數(shù)來(lái)調(diào)整maven管理的所有項(xiàng)目的配置。
settings.xml中的profile元素是pom.xml中profile元素的裁剪版本。它包含了id、activation、repositories、pluginRepositories和 properties元素。這里的profile元素只包含這五個(gè)子元素是因?yàn)檫@里只關(guān)心構(gòu)建系統(tǒng)這個(gè)整體(這正是settings.xml文件的角色定位),而非單獨(dú)的項(xiàng)目對(duì)象模型設(shè)置。
如果一個(gè)settings.xml中的profile被激活,它的值會(huì)覆蓋任何其它定義在pom.xml中帶有相同id的profile。當(dāng)所有的約束條件都滿足的時(shí)候就會(huì)激活這個(gè)profile。
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">
...
<!--
| 構(gòu)建方法的配置清單, maven 將根據(jù)不同環(huán)境參數(shù)來(lái)使用這些構(gòu)建配置。
| settings.xml 中的 profile 元素是 pom.xml 中 profile 元素的裁剪版本。
| settings.xml 負(fù)責(zé)的是整體的構(gòu)建過(guò)程, pom.xml 負(fù)責(zé)單獨(dú)的項(xiàng)目對(duì)象構(gòu)建過(guò)程。
| settings.xml 只包含了id, activation, repositories, pluginRepositories 和 properties 元素。
|
| 如果 settings 中的 profile 被激活, 它的值會(huì)覆蓋任何其它定義在 pom.xml 中或 profile.xml 中的相同 id 的 profile。
|
| 查看當(dāng)前激活的 profile:
| mvn help:active-profiles
|-->
<profiles>
<profile>
<!-- 該配置的唯一標(biāo)識(shí)符 -->
<id>profile_id</id>
<!--
| profile 的激活條件配置;
| 其他激活方式:
| 1. 通過(guò) settings.xml 文件中的 activeProfile 元素進(jìn)行指定激活。
| 2. 在命令行, 使用-P標(biāo)記和逗號(hào)分隔的列表來(lái)顯式的激活, 如: mvn clean package -P myProfile)。
|-->
<activation>
<!-- 是否默認(rèn)激活 -->
<activeByDefault>false</activeByDefault>
<!-- 內(nèi)建的 java 版本檢測(cè), 匹配規(guī)則: https://maven.apache.org/enforcer/enforcer-rules/versionRanges.html -->
<jdk>9.9</jdk>
<!-- 內(nèi)建操作系統(tǒng)屬性檢測(cè), 配置規(guī)則: https://maven.apache.org/enforcer/enforcer-rules/requireOS.html -->
<os>
<!-- 操作系統(tǒng) -->
<name>Windows XP</name>
<!-- 操作系統(tǒng)家族 -->
<family>Windows</family>
<!-- 操作系統(tǒng) -->
<arch>x86</arch>
<!-- 操作系統(tǒng)版本 -->
<version>5.1.2600</version>
</os>
<!--
| 如果Maven檢測(cè)到某一個(gè)屬性(其值可以在POM中通過(guò)${名稱}引用), 并且其擁有對(duì)應(yīng)的名稱和值, Profile就會(huì)被激活。
| 如果值字段是空的, 那么存在屬性名稱字段就會(huì)激活profile, 否則按區(qū)分大小寫(xiě)方式匹配屬性值字段
|-->
<property>
<!-- 屬性名 -->
<name>mavenVersion</name>
<!-- 屬性值 -->
<value>2.0.3</value>
</property>
<!-- 根據(jù)文件存在/不存在激活profile -->
<file>
<!-- 如果指定的文件存在, 則激活profile -->
<exists>/path/to/active_on_exists</exists>
<!-- 如果指定的文件不存在, 則激活profile -->
<missing>/path/to/active_on_missing</missing>
</file>
</activation>
<!-- 擴(kuò)展屬性設(shè)置。擴(kuò)展屬性可以在 POM 中的任何地方通過(guò) ${擴(kuò)展屬性名} 進(jìn)行引用
|
| 屬性引用方式(包括擴(kuò)展屬性, 共 5 種屬性可以引用):
|
| env.x : 引用 shell 環(huán)境變量, 例如, "env.PATH"指代了 $path 環(huán)境變量(在 Linux / Windows 上是 %PATH% ).
| project.x : 引用 pom.xml(根元素就是 project) 中 xml 元素內(nèi)容.例如 ${project.artifactId} 可以獲取 pom.xml 中設(shè)置的 <artifactId /> 元素的內(nèi)容
| settings.x : 引用 setting.xml(根元素就是 setting) 中 xml 元素內(nèi)容, 例如 ${settings.offline}
| Java System Properties : 所有可通過(guò) java.lang.System.getProperties() 訪問(wèn)的屬性都能在通過(guò) ${property_name} 訪問(wèn), 例如 ${java.home}
| x : 在 <properties/> 或者 外部文件 中設(shè)置的屬性, 都可以 ${someVar} 的形式使用
|
|-->
<properties>
<!-- 在當(dāng)前 profile 被激活時(shí), ${profile.property} 就可以被訪問(wèn)到了 -->
<profile.property>this.property.is.accessible.when.current.profile.actived</profile.property>
</properties>
<!-- 遠(yuǎn)程倉(cāng)庫(kù)列表 -->
<repositories>
<!--
| releases vs snapshots
| maven 針對(duì) releases、snapshots 有不同的處理策略, POM 就可以在每個(gè)單獨(dú)的倉(cāng)庫(kù)中, 為每種類型的 artifact 采取不同的策略
| 例如:
| 開(kāi)發(fā)環(huán)境 使用 snapshots 模式實(shí)時(shí)獲取最新的快照版本進(jìn)行構(gòu)建
| 生成環(huán)境 使用 releases 模式獲取穩(wěn)定版本進(jìn)行構(gòu)建
| 參見(jiàn)repositories/repository/releases元素
|-->
<!--
| 依賴包不更新問(wèn)題:
| 1. Maven 在下載依賴失敗后會(huì)生成一個(gè).lastUpdated 為后綴的文件。如果這個(gè)文件存在, 那么即使換一個(gè)有資源的倉(cāng)庫(kù)后, Maven依然不會(huì)去下載新資源。
| 可以通過(guò) -U 參數(shù)進(jìn)行強(qiáng)制更新、手動(dòng)刪除 .lastUpdated 文件:
| find . -type f -name "*.lastUpdated" -exec echo {}" found and deleted" \; -exec rm -f {} \;
|
| 2. updatePolicy 設(shè)置更新頻率不對(duì), 導(dǎo)致沒(méi)有觸發(fā) maven 檢查本地 artifact 與遠(yuǎn)程 artifact 是否一致
|-->
<repository>
<!-- 遠(yuǎn)程倉(cāng)庫(kù)唯一標(biāo)識(shí) -->
<id>maven_repository_id</id>
<!-- 遠(yuǎn)程倉(cāng)庫(kù)名稱 -->
<name>maven_repository_name</name>
<!-- 遠(yuǎn)程倉(cāng)庫(kù)URL, 按protocol://hostname/path形式 -->
<url>http://host/maven</url>
<!--
| 用于定位和排序 artifact 的倉(cāng)庫(kù)布局類型-可以是 default(默認(rèn))或者 legacy(遺留)
| Maven 2為其倉(cāng)庫(kù)提供了一個(gè)默認(rèn)的布局;然而, Maven 1.x有一種不同的布局。我們可以使用該元素指定布局是default(默認(rèn))還是legacy(遺留)
| -->
<layout>default</layout>
<!-- 如何處理遠(yuǎn)程倉(cāng)庫(kù)里發(fā)布版本的下載 -->
<releases>
<!-- 是否允許該倉(cāng)庫(kù)為 artifact 提供 發(fā)布版 / 快照版 下載功能 -->
<enabled>false</enabled>
<!--
| 每次執(zhí)行構(gòu)建命令時(shí), Maven 會(huì)比較本地 POM 和遠(yuǎn)程 POM 的時(shí)間戳, 該元素指定比較的頻率。
| 有效選項(xiàng)是:
| always(每次構(gòu)建都檢查), daily(默認(rèn), 距上次構(gòu)建檢查時(shí)間超過(guò)一天), interval: x(距上次構(gòu)建檢查超過(guò) x 分鐘)、 never(從不)
|
| 重要:
| 設(shè)置為 daily, 如果 artifact 一天更新了幾次, 在一天之內(nèi)進(jìn)行構(gòu)建, 也不會(huì)從倉(cāng)庫(kù)中重新獲取最新版本
|-->
<updatePolicy>always</updatePolicy>
<!-- 當(dāng) Maven 驗(yàn)證 artifact 校驗(yàn)文件失敗時(shí)該怎么做: ignore(忽略), fail(失?。? 或者warn(警告) -->
<checksumPolicy>warn</checksumPolicy>
</releases>
<!-- 如何處理遠(yuǎn)程倉(cāng)庫(kù)里快照版本的下載 -->
<snapshots>
<enabled />
<updatePolicy />
<checksumPolicy />
</snapshots>
</repository>
<!--
國(guó)內(nèi)可用的 maven 倉(cāng)庫(kù)地址(updated @ 2019-02-08):
http://maven.aliyun.com/nexus/content/groups/public
http://maven.wso2.org/nexus/content/groups/public/
http://jcenter.bintray.com/
http://maven.springframework.org/release/
http://repository.jboss.com/maven2/
http://uk.maven.org/maven2/
http://repo1.maven.org/maven2/
http://maven.springframework.org/milestone
http://maven.jeecg.org/nexus/content/repositories/
http://repo.maven.apache.org/maven2
http://repo.spring.io/release/
http://repo.spring.io/snapshot/
http://mavensync.zkoss.org/maven2/
https://repository.apache.org/content/groups/public/
https://repository.jboss.org/nexus/content/repositories/releases/
-->
</repositories>
<!--
| maven 插件的遠(yuǎn)程倉(cāng)庫(kù)配置。maven 插件實(shí)際上是一種特殊類型的 artifact。
| 插件倉(cāng)庫(kù)獨(dú)立于 artifact 倉(cāng)庫(kù)。pluginRepositories 元素的結(jié)構(gòu)和 repositories 元素的結(jié)構(gòu)類似。
|-->
<!--
<pluginRepositories>
<pluginRepository>
<releases>
<enabled />
<updatePolicy />
<checksumPolicy />
</releases>
<snapshots>
<enabled />
<updatePolicy />
<checksumPolicy />
</snapshots>
<id />
<name />
<url />
<layout />
</pluginRepository>
</pluginRepositories>
-->
</profile>
</profiles>
...
</settings>
激活發(fā)生在所有指定的條件都滿足時(shí),盡管不是一次需要所有條件。
- Activation:自動(dòng)觸發(fā)profile的條件邏輯。這是profile中最重要的元素。
跟pom.xml中的profile一樣,settings.xml中的profile也可以在特定環(huán)境下改變一些值,而這些環(huán)境是通過(guò)activation元素來(lái)指定的。activation元素并不是激活profile的唯一方式。
settings.xml文件中的元素可以包含profile的id。profile也可以通過(guò)在命令行,使用-P選項(xiàng)和id(可以是逗號(hào)分隔的列表)來(lái)顯式的激活(如,-P test)。 - activeByDefault:當(dāng)其值為true的時(shí)候表示如果沒(méi)有其他的profile處于激活狀態(tài)的時(shí)候,該profile將自動(dòng)被激活。
jdk:表示當(dāng)jdk的版本滿足條件的時(shí)候激活,在這里是1.6。這里的版本還可以用一個(gè)范圍來(lái)表示,如
[1.4,1.7) 表示1.4、1.5和1.6滿足;
[1.4,1.7] 表示1.4、1.5、1.6和1.7滿足; - os:表示當(dāng)操作系統(tǒng)滿足條件的時(shí)候激活。
- property:property是鍵值對(duì)的形式,表示當(dāng)Maven檢測(cè)到了這樣一個(gè)鍵值對(duì)的時(shí)候就激活該profile。
當(dāng)存在屬性hello的時(shí)候激活該profile。
Active Profiles(激活配置文件Profiles的Profile)
手動(dòng)激活profiles的列表,按照profile被應(yīng)用的順序定義activeProfile。
該元素包含了一組activeProfile元素,每個(gè)activeProfile都含有一個(gè)profile的id。
任何在activeProfile中定義的profile的id,不論環(huán)境設(shè)置如何,其對(duì)應(yīng)的 profile都會(huì)被激活。如果沒(méi)有匹配的profile,則什么都不會(huì)發(fā)生。
例如,env-test是一個(gè)activeProfile,則在pom.xml(或者profile.xml)中對(duì)應(yīng)id的profile會(huì)被激活。如果運(yùn)行過(guò)程中找不到這樣一個(gè)profile,Maven則會(huì)像往常一樣運(yùn)行。
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">
...
<activeProfiles>
<activeProfile>profile_id</activeProfile>
</activeProfiles>
</settings>
參考文檔
【3】Maven的標(biāo)準(zhǔn)settings.xml文件
到此這篇關(guān)于Maven配置文件settings.xml的實(shí)現(xiàn)的文章就介紹到這了,更多相關(guān)Maven settings.xml內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
Java org.w3c.dom.Document 類方法引用報(bào)錯(cuò)
這篇文章主要介紹了Java org.w3c.dom.Document 類方法引用報(bào)錯(cuò)的解決方案,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2021-08-08
spring中WebClient如何設(shè)置連接超時(shí)時(shí)間以及讀取超時(shí)時(shí)間
這篇文章主要給大家介紹了關(guān)于spring中WebClient如何設(shè)置連接超時(shí)時(shí)間以及讀取超時(shí)時(shí)間的相關(guān)資料,WebClient是Spring框架5.0引入的基于響應(yīng)式編程模型的HTTP客戶端,它提供一種簡(jiǎn)便的方式來(lái)處理HTTP請(qǐng)求和響應(yīng),需要的朋友可以參考下2024-08-08
Spring?Data?Redis切換底層Jedis和Lettuce實(shí)現(xiàn)源碼解析
這篇文章主要為大家介紹了Spring?Data?Redis切換底層Jedis和Lettuce實(shí)現(xiàn)方法源碼解析,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2023-11-11
java實(shí)現(xiàn)將Webp轉(zhuǎn)為jpg格式方式
這篇文章主要介紹了java實(shí)現(xiàn)將Webp轉(zhuǎn)為jpg格式方式,具有很好的參考價(jià)值,希望對(duì)大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2024-07-07
SpringBoot的配置文件application.yml及加載順序詳解
這篇文章主要介紹了SpringBoot的配置文件application.yml及加載順序,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2023-07-07
解決springboot 實(shí)體類String轉(zhuǎn)Date類型的坑
這篇文章主要介紹了解決springboot 實(shí)體類String轉(zhuǎn)Date類型的坑,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2021-10-10

