View on GitHub


This is a maven plugin that scans your Jersey resources and automatically generating client-side code to reach your REST API.

Download this project as a .zip file Download this project as a tar.gz file

REST API Codegenerator Maven Plugin

Are you sick of always having to implement and maintain the client-side services for reaching your Rest API. With the REST API Codegenerator Maven Plugin you are able to automatically generate the client-side code to reach your API.

For now the plugin scans your code for Jersey resources and generates java code - see example of usage in the akka-persistence-java-example-project. In my next project I will extend the plugin to generate ReactJS code aswell.

If you find the plugin useful please give it a star. Also feel free to create pull requests and extend the plugin to generate for example Ajax, AngularJS or ReactJS code.

How to use the plugin for generating Java code

  1. Add the plugin to your pom.xml file, see example below.
  2. Run mvn clean install in your project folder
  3. The plugin will scan your source code and generate code out of your resource classes.

Plugin example for generating Java and React code


Dependencies required


If you are using MediaType.APPLICATION_JSON_TYPE you also need this dependency


How to get started developing

  1. Clone this repo git clone
  2. Run mvn clean install in the restapi-codegen-maven-plugin-folder
  3. The unit tests have now generated some example code at /src/test/java/com/example/helloworld/

Why this plugin

Over the years I have created a few REST API’s, and I always end up using a lot of time implementing the client-side code for reaching the API’s. In one of the projects we had a Quality-test application implemented in java that ran tests continuously, something that required updating the client-side code rapidly. With this challenge we ended up creating a lot of the same boilerplate code for each new service we implemented, and it felt like this code should and could be automatically generated.

In the pursuit of finding such a product I ended up creating a plugin to solve my current need. The result became this plugin.

I hope this can be useful for others as well.