[maven] improve documentation regarding depedencies issues (#5326)

* [maven] improve documentation regarding depedencies issues

* Improve english on the documentation

Co-Authored-By: Jim Schubert <james.schubert@gmail.com>

* Improve the english on the documentation

Co-Authored-By: Jim Schubert <james.schubert@gmail.com>

Co-authored-by: Jim Schubert <james.schubert@gmail.com>
This commit is contained in:
Paulo Oliveira
2020-02-18 13:22:44 +00:00
committed by GitHub
parent f9a040d1a7
commit a46e2e1470

View File

@@ -41,6 +41,28 @@ mvn clean compile
For full details of all options, see the [plugin README](https://github.com/OpenAPITools/openapi-generator/tree/master/modules/openapi-generator-maven-plugin).
### Dependencies
The generated models use commonly use Swagger v2 annotations like `@ApiModelProperty`. A user may add Swagger v3 annotations:
```xml
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-annotations</artifactId>
</dependency>
```
But this will not work. This dependency is not binary compatible with Swagger v2 annotations. The resulting code will fail to compile.
As alternative instead use the following dependency:
```xml
<dependency>
<groupId>io.swagger.parser.v3</groupId>
<artifactId>swagger-parser</artifactId>
</dependency>
```
## Gradle
This gradle plugin offers a declarative DSL via extensions (these are Gradle project extensions). These map almost fully 1:1 with the options youd pass to the CLI or Maven plugin. The plugin maps the extensions to a task of the same name to provide a clean API. If youre interested in the extension/task mapping concept from a high-level, you can check out [Gradles docs](https://docs.gradle.org/current/userguide/custom_plugins.html#sec:mapping_extension_properties_to_task_properties).