How to use raml-to-jaxrs in maven


I am trying to generate my klient java api from raml file with the maven plugin raml-to-jaxrs-maven-plugin.

I have tried to use example for maven in

When I run mvn raml:generate on my project all java files get in the <my rest api maven module>\target\generated-sources\raml-to-jaxrs-maven-plugin\se<mydomain><myproduct><my restapi raml filename> in 3 folder model, resources and support

My goal is to compile this java files and put the class files them into a jar file to use by another maven module in the project.

I don’t understand why the maven plugin put the generated source files in the target structure.

I compair it with the cxf-codegen-plugin for ws that have a <sourceRoot>${basedir}/src/main/java</sourceRoot> tag that generate source and build it to class and package it in a jar file.

Can anyone help me to setup a maven build that generate jar file with the generated classes?

Part of my maven file

<version>{raml-to-jaxrs-maven-plugin.version}</version>; <configuration> <ramlFile> {[0].directory}/rest/consume//



If i run “mvn clean install” i get the raml and json files package in the jar file. The folder generated-sources is not included. It still generated under target folder.