W3Cschool
恭喜您成為首批注冊(cè)用戶
獲得88經(jīng)驗(yàn)值獎(jiǎng)勵(lì)
只需添加
compile "org.springframework.cloud:spring-cloud-starter-stub-runner"
用@EnableStubRunnerServer
注釋課程,建立一個(gè)胖子罐,就可以開始了!
對(duì)于屬性,請(qǐng)檢查Stub Runner Spring部分。
您可以從Maven下載獨(dú)立的JAR(例如對(duì)于版本2.0.1.RELEASE),如下所示:
$ wget -O stub-runner.jar 'https://search.maven.org/remotecontent?filepath=org/springframework/cloud/spring-cloud-contract-stub-runner-boot/2.0.1.RELEASE/spring-cloud-contract-stub-runner-boot-2.0.1.RELEASE.jar'
$ java -jar stub-runner.jar --stubrunner.ids=... --stubrunner.repositoryRoot=...
從Spring Cloud CLI
項(xiàng)目的1.4.0.RELEASE
版本開始,您可以通過執(zhí)行spring cloud stubrunner
啟動(dòng)Stub Runner引導(dǎo)。
為了通過配置,只需在當(dāng)前工作目錄或名為config
的子目錄中或在~/.spring-cloud
中創(chuàng)建一個(gè)stubrunner.yml
文件。該文件可能如下所示(運(yùn)行本地安裝的存根示例)
stubrunner.yml。
stubrunner: stubsMode: LOCAL ids: - com.example:beer-api-producer:+:9876
然后只需從終端窗口調(diào)用spring cloud stubrunner
即可啟動(dòng)Stub Runner服務(wù)器。它將在端口8750
上可用。
Copyright©2021 w3cschool編程獅|閩ICP備15016281號(hào)-3|閩公網(wǎng)安備35020302033924號(hào)
違法和不良信息舉報(bào)電話:173-0602-2364|舉報(bào)郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號(hào)
聯(lián)系方式:
更多建議: