Plugin execution

The following command must be used to generate the Java classes:

mvn contraect:generate-contraects

After the plugin execution you should find the generated Java classes in the folder you specified through the configuration property targetPath.

Add generated classes to sources

Currently it isn't possible to automatically use the folder of the generated classes as source folder. We have an open issue regarding that and will probably add this feature later on.

Option 1

Add the folder manually as source-folder within your IDE.

Option 2

Generate classes directly into the regular source folder by defining src/main/java as targetPath.

Note: with this solution you will probably end up having the generated files committed to the repo

Option 3

Add the resources using the build-helper-maven-plugin:

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${project.build.directory}/generated-sources/contraect</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>

‚Äč