The module provide generation of retrofit services and models.
run mvn compile if prepared phase compile
plugin can be executed directly: mvn swagger-to-retrofit:generate
need prepare pom with parameter io.github.phantomstr.testing.tool.swagger2retrofit.swagger2retrofit.commandline
where
required
-u or --url : path to swagger api
optional
-mp or --modelsPackage : package where will be compiled models
-sp or --servicePackage : package where will be compiled services
-ar or --apiRoot : root of api. Will be removed from path start
-sf or --serviceFilters : regexp filter of generated services
example:
<project>
<properties>
<io.github.phantomstr.testing.tool.swagger2retrofit.swagger2retrofit.commandline>-u http://localhost:8080/v2/api-docs -mp io.github.phantomstr.testing.tool.rest.model -sp
io.github.phantomstr.testing.tool.rest.service
</io.github.phantomstr.testing.tool.swagger2retrofit.swagger2retrofit.commandline>
</properties>
<build>
<plugins>
<plugin>
<groupId>io.github.phantomstr.testing-tools</groupId>
<artifactId>swagger-to-retrofit</artifactId>
<version>1.1.8</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
-
For scheme generation lombok 1.18.20 in local repository is required.
-
Lombok plugin required File | Settings | Plugins | Marketplace | find "lombok" | install
-
Annotation processing required (check option):
File | Settings | Build, Execution, Deployment | Compiler | Annotation Processors |Enable annotation processing
- Maven - Dependency Management
We use SemVer for versioning.