0

I am using maven jaxb2 plugin to generate the classes from xsd.

However, the XJC generates the classes each time, I run mvn clean install, though I have not modified the XSD /binding files.

PS:I have to do clean install as it's required for other tasks.

forceRegenerate =false is not working

Pls guide.

pom.xml

<plugin>
                <groupId>org.jvnet.jaxb2.maven2</groupId>
                <artifactId>maven-jaxb2-plugin</artifactId>
                <version>0.12.3</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <schemaLanguage>WSDL</schemaLanguage>
                    <!-- TODO need to confirm if directly updating source files are ok. 
                        or should we move to target directory -->
                    <bindingDirectory>${basedir}/src/main/resources/wsdl</bindingDirectory>
                    <generateDirectory>${basedir}/src/main/java</generateDirectory>
                    <generatePackage>com.abc.def.chg.beans</generatePackage>
                    <specVersion>2.1</specVersion>
                    <forceRegenerate>false</forceRegenerate>
                    <plugins>
                        <plugin>
                            <groupId>org.jvnet.jaxb2_commons</groupId>
                            <artifactId>jaxb2-basics</artifactId>
                            <version>0.9.3</version>
                        </plugin>
                        <plugin>
                            <groupId>org.jvnet.jaxb2_commons</groupId>
                            <artifactId>jaxb2-basics-annotate</artifactId>
                            <version>1.0.1</version>
                        </plugin>
                    </plugins>
                    <args>
                        <arg>-Xannotate</arg>
                        <arg>-XtoString</arg>
                    </args>
                    <schemas>
                        <schema>
                            <fileset>
                                <!-- Defaults to schemaDirectory. -->
                                <directory>${basedir}/src/main/resources/wsdl</directory>
                                <!-- Defaults to schemaIncludes. -->
                                <includes>
                                    <include>*.xsd</include>
                                </includes>
                                <!-- Defaults to schemaIncludes -->
                            </fileset>
                        </schema>
                    </schemas>
                </configuration>
            </plugin>
TheCodeGladiator
  • 173
  • 3
  • 12

1 Answers1

0

Please run mvn clean install -X and check the log. It should explain, why the code is regenerated (look for depends and produces lines).

lexicore
  • 42,748
  • 17
  • 132
  • 221