作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我的 build.gradle 文件中有以下配置
plugins {
id 'java'
id 'org.openapi.generator' version '4.1.3'
}
repositories {
maven { url "https://mavenrepo.schwab.com/nexus/content/groups/public" }
maven { url "https://mavenrepo.schwab.com/nexus/content/repositories/releases/" }
mavenCentral()
jcenter()
}
sourceSets.main.java.srcDirs += "$buildDir/generated/src/main/java"
openApiGenerate {
generatorName = "java"
inputSpec = "$rootDir/API/POMOrchestrator.v1.json".toString()
outputDir = "$rootDir/application/".toString()
apiPackage = "com.schwab.brokerage.party.onborading.api.inbound.rest.controller"
invokerPackage = "com.schwab.brokerage.party.onborading"
modelPackage = "com.schwab.brokerage.party.onborading.models.swagger"
modelNamePrefix = "Party"
configOptions = [
dateLibrary: "java8-localdatetime"
]
}
compileJava.dependsOn tasks.openApiGenerate
当我执行以下命令时
gradle openApiGenerators --warning-mode all
我得到以下输出,没有错误(明显错误,因为我认为它不喜欢我的生成器名称),没有输出类。
> Configure project :
Using method ObjectFactory.property() method to create a property of type Map<K, V> has been deprecated. This will fail with an error in Gradle 6.0. Please use the Ob
jectFactory.mapProperty() method instead.
> Task :openApiGenerators
The following generators are available:
CLIENT generators:
- ada
- android
- apex
- bash
- c
- clojure
- cpp-qt5-client
- cpp-restsdk
- cpp-tizen
- csharp
- csharp-netcore
- dart
- dart-jaguar
- eiffel
- elixir
- elm
- erlang-client
- erlang-proper
- flash
- go
- go-experimental (experimental)
- groovy
- haskell-http-client
- java
- javascript
- javascript-closure-angular
- javascript-flowtyped
- jaxrs-cxf-client
- jmeter
- kotlin
- lua
- nim (beta)
- objc
- ocaml
- perl
- php
- powershell
- python
- python-experimental (experimental)
- r
- ruby
- rust
- scala-akka
- scala-gatling
- scalaz
- swift4
- typescript-angular
- typescript-angularjs
- typescript-aurelia
- typescript-axios
- typescript-fetch
- typescript-inversify
- typescript-jquery
- typescript-node
- typescript-rxjs
SERVER generators:
- ada-server
- aspnetcore
- cpp-pistache-server
- cpp-qt5-qhttpengine-server
- cpp-restbed-server
- csharp-nancyfx
- erlang-server
- fsharp-functions (beta)
- fsharp-giraffe-server (beta)
- go-gin-server
- go-server
- graphql-nodejs-express-server
- haskell
- java-inflector
- java-msf4j
- java-pkmst
- java-play-framework
- java-undertow-server
- java-vertx
- jaxrs-cxf
- jaxrs-cxf-cdi
- jaxrs-cxf-extended
- jaxrs-jersey
- jaxrs-resteasy
- jaxrs-resteasy-eap
- jaxrs-spec
- kotlin-server
- kotlin-spring
- kotlin-vertx (beta)
- nodejs-express-server (beta)
- php-laravel
- php-lumen
- php-silex
- php-slim
- php-symfony
- php-ze-ph
- python-aiohttp
- python-blueplanet
- python-flask
- ruby-on-rails
- ruby-sinatra
- rust-server
- scala-finch
- scala-lagom-server
- scala-play-server
- scalatra
- spring
DOCUMENTATION generators:
- asciidoc
- cwiki
- dynamic-html
- html
- html2
- openapi
- openapi-yaml
SCHEMA generators:
- avro-schema (beta)
- mysql-schema
CONFIG generators:
- apache2
- graphql-schema
- protobuf-schema (beta)
OTHER generators:
BUILD SUCCESSFUL in 2s
1 actionable task: 1 executed
第一次尝试这个,不知道哪里出了问题。
最终我想让这个工作正常,然后指定模板,以便我可以添加 lombok 注释(如本问题 Gradle Swagger CodeGen DefaultGenerator CodegenConfigurator Add Lombok 中所述,但尚未回答)。但是,我必须首先让代码生成工作。
最佳答案
我调用了错误的方法。 openApiGenerators 只是列出了它正在做的事情的生成器。要生成输出,您必须调用上面创建的任务 openApiGenerate。感谢@philonous 的回答。
关于java - Gradle 构建文件 org.openapi.generator openApiGenerate 列表生成器 openApiGenerators 无输出 无错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61687998/
我的 build.gradle 文件中有以下配置 plugins { id 'java' id 'org.openapi.generator' version '4.1.3' } re
以下是我的build.gradle配置 plugins { id 'java' id 'maven-publish' id 'org.springframework.boot'
我是一名优秀的程序员,十分优秀!