0

I use Spring Object-Xml mapping with Jibx to convert some xsd files to Java source files. Jibx is called by jibx-maven-plugin in the build process. My schema files (.xsd) are in directory resources/oxm/schemas, my Java-XSD bindings files (.xml) are in directory resources/oxm/bindings and I want to save the output Java source files to directory src.

My plugin configuration in the pom.xml is:

<plugin>
    <groupId>org.jibx</groupId>
    <artifactId>jibx-maven-plugin</artifactId>
    <version>1.2.3</version>
    <configuration>
        <schemaLocation>${basedir}/resources/oxm/schemas</schemaLocation>
        <baseBindingDirectory>${basedir}/resources/oxm/bindings</baseBindingDirectory>
        <schemaBindingDirectory>${basedir}/src</schemaBindingDirectory>
        <defaultPackage>com.ibm.tp4.schema</defaultPackage>
        <customizations>
            <customization>${basedir}/resources/oxm/customizations.xml</customization>
        </customizations>
        <verbose>true</verbose>
    </configuration>
</plugin>

The sources are generated inside the src directory as expected. The problem is that the the bindings in resources/oxm/bindings/ directory are copied to the src directory too. Why the plugin copies my xsd-Java source bindings around? Would someone possibly need the bindings in the output jar/war/whatever to create xsd/source files at run time? How could I disable this generation of xmls inside my src folder? If I can't, how could I add a step in Maven build of jibx-maven plugin (running jibx:schema-codegen phase right now to generate Java source files) to delete these files after they are generated?

Thanks in advance.

Alan Evangelista
  • 2,888
  • 6
  • 35
  • 45
  • You should not generate into the src areas. The usual folder for generating something during the build is the target folder which is the convention and the default of the plugin and in general of Maven. – khmarbaise Aug 10 '12 at 07:43
  • If possible, I want to change that Maven convention in my project. I want all my source files to be inside the src directory, regardless if they are generated manually or by a tool. – Alan Evangelista Aug 11 '12 at 20:33

0 Answers0