How to optimize Maven JiBX Plugin

588 views Asked by At

While using jibx:bind goal in a maven project, is it possible to optimize the plugin so that it generates schema binding only when the .xsd (schema) itself changes? The only way I can find it to avoid running a goal is to create profiles, but I don't want to selectively bind or skip binding: what I would like is for the plugin to detect that already generated source files have a later date than the .xsd themselves.

Here is how the build section of my pom.xml looks at the moment:

<build>
    <plugins>
        <plugin>
            <groupId>org.jibx</groupId>
            <artifactId>jibx-maven-plugin</artifactId>
            <version>1.2.6</version>
            <configuration>
                <schemaBindingDirectory>src/main/resources/bindingmapping</schemaBindingDirectory>
                <includeSchemaBindings>
                    <includeSchemaBindings>binding.xml</includeSchemaBindings>
                </includeSchemaBindings>
                <verbose>true</verbose>
            </configuration>
            <executions>
                <execution>
                    <goals>
                        <goal>bind</goal>
                    </goals>
                </execution>
            </executions>
            <dependencies>
                <dependency>
                  <groupId>org.jibx</groupId>
                  <artifactId>jibx-bind</artifactId>
                  <version>1.2.5</version>
                  <exclusions>
                     <exclusion>
                        <artifactId>bcel</artifactId>
                        <groupId>bcel</groupId>
                    </exclusion>
                </exclusions>
                </dependency>
                <dependency>
                    <groupId>org.apache.bcel</groupId>
                    <artifactId>bcel</artifactId>
                    <version>6.0-SNAPSHOT</version>
               </dependency>
            </dependencies>
        </plugin>
    </plugins>
</build>
1

There are 1 answers

0
Don Corley On BEST ANSWER

No, currently we don't check the date of the generated schema to skip a rebuild. It's on my to-do list. Sorry.

BTW., Be sure to upgrade to the latest version of JiBX 1.3.1. You should be able to remove that BPEL dependency, since JiBX now supports JDK 1.8.

Cheers,

Don Corley - JiBX Maven Plugin Author