簡體   English   中英

Swagger codegen 降級 gradle 版本

[英]Swagger codegen downgrades gradle version

我在 eclipse 中創建了一個 gradle spring 引導項目。 現在我想添加一個由我放入項目中的 swagger-codegen-cli.jar(版本 3.0.20)生成的客戶端。

執行后

java -jar swagger-codegen-cli.jar generate -i https://petstore.swagger.io/v2/swagger.yaml -l java --library resttemplate  > msg.txt

在 powershell 中,某些 gradle 文件被覆蓋。 最引人注目的gradle-wrapper.properties改變了這一行

distributionUrl=https\://services.gradle.org/distributions/gradle-6.4.1-bin.zip

.../gradle-2.6-bin.zip並添加 2016 年的時間戳?!

我也得到錯誤:

Description Resource    Path    Location    Type
Could not fetch model of type 'EclipseProject' using Gradle distribution 'https://services.gradle.org/distributions/gradle-2.6-bin.zip'.
Build file 'C:\Users\me\workspace\projectname\build.gradle' line: 2
An exception occurred applying plugin request [id: 'org.springframework.boot', version: '2.3.1.RELEASE']
Failed to apply plugin [id 'org.springframework.boot']
Spring Boot plugin requires Gradle 5 (5.6.x only) or Gradle 6 (6.3 or later). The current version is Gradle 2.6 build.gradle    /demo   line 2  Gradle Error Marker

我試圖將版本號更改回gradle-wrapper.properties ,但僅此一項似乎無濟於事。 但是 grep 沒有發現任何其他出現的“2.6”我想了解為什么 gradle 版本會更改以及如何避免這種情況。

發現在swagger-config.json中添加"additional-properties": {"ignoreFileOverride":"gradle-wrapper.properties"}可以讓我們的構建暫時進行。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM