I want to store the generated classes in src/main/java directory but due to default setting of jibx-maven-plugin .java files goes to target/generated-sources.
This is my current pom.xml
file where I modified values of <schemaBindingDirectory>
but target path is not changed.
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.jibx</groupId>
<artifactId>jibx-maven-plugin</artifactId>
<version>1.2.5</version>
<executions>
<execution>
<id>generate-java-code-from-schema</id>
<goals>
<goal>schema-codegen</goal>
</goals>
<configuration>
<schemaLocation>src/main/config</schemaLocation>
<includeSchemas>
<includeSchema>example1.xsd</includeSchema>
</includeSchemas>
<options>
<package>com.poc.jibx</package>
</options>
</configuration>
</execution>
<execution>
<id>compile-binding</id>
<goals>
<goal>bind</goal>
</goals>
<configuration>
<schemaBindingDirectory>src/main/java</schemaBindingDirectory>
<load>true</load>
<validate>true</validate>
<!--<verbose>true</verbose>-->
<verify>true</verify>
</configuration>
</execution>
<execution>
<id>bind-xml</id>
<goals>
<goal>bind</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jibx.config</groupId>
<artifactId>maven-plugin-reactor</artifactId>
<version>1.3.4-SNAPSHOT</version>
</plugin>
</plugins>
</pluginManagement>
</build>
Is there any changes required in build.xml file? Is there any other error in pom.xml files? May someone help me in changing the path? Thanks in advance for any help.
If you want the generated java files to be created in src/main/java, include the:
<schemaBindingDirectory>src/main/java</schemaBindingDirectory>
in your bind configuration before the schemaLocation tag.
This tag is not included in the JiBX documentation because typically you do not want generated files to be included in your source path.
We strongly recommend that you use the default file locations so that you do not accidentally commit any generated files.