davidmoten / jax-maven-plugin

maven plugin support for xjc, wsimport, wsgen, schemagen for Java 8,9,10,11+
Apache License 2.0
34 stars 12 forks source link

Caching Results? #14

Open brcolow opened 5 years ago

brcolow commented 5 years ago

Hello,

First of all thank you for your plugin - it is working great for my purposes.

My question is related to caching the generated files (via wsimport, wsgen, and xjc, for example). Currently it seems that even if the schema file or bindings file does not change the classes are always re-generated (and without calling clean in between). This makes builds quite slow. Am I missing some config somewhere or is caching not supported yet? Maybe this falls under the category of "Plugin support for Incremental Builds"?

Here is my POM config:

           <plugin>
                <groupId>com.github.davidmoten</groupId>
                <artifactId>jax-maven-plugin</artifactId>
                <version>0.1.6</version>
                <dependencies>
                    <dependency>
                        <groupId>org.jvnet.jaxb2_commons</groupId>
                        <artifactId>jaxb2-basics</artifactId>
                        <version>1.11.1</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <id>wsimport</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>wsimport</goal>
                        </goals>
                        <configuration>
                            <arguments>
                                <!-- These are the arguments you would normally
                                    have put with a call to wsimport -->
                                <argument>-verbose</argument>
                                <argument>-keep</argument>
                                <argument>-d</argument>
                                <argument>${jaxws.generated.classes}</argument>
                                <argument>-s</argument>
                                <argument>${jaxws.generated.sources}</argument>
                                <argument>${project.basedir}/src/main/resources/wsdl/qbwc.wsdl</argument>
                            </arguments>
                        </configuration>
                    </execution>
                    <execution>
                        <id>wsgen</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>wsgen</goal>
                        </goals>
                        <configuration>
                            <classpathScope>compile</classpathScope>
                            <arguments>
                                <!-- These are the arguments you would normally
                                    have put with a call to wsimport -->
                                <argument>-verbose</argument>
                                <argument>-keep</argument>
                                <argument>-d</argument>
                                <argument>${jaxws.generated.classes}</argument>
                                <argument>-s</argument>
                                <argument>${jaxws.generated.sources}</argument>
                                <argument>-r</argument>
                                <argument>${jaxws.generated.resources}</argument>
                                <argument>WebConnector</argument>
                            </arguments>
                        </configuration>
                    </execution>
                    <execution>
                        <id>xjc-generate-from-xsd</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>xjc</goal>
                        </goals>
                        <configuration>
                            <systemProperties>
                                <enableExternalEntityProcessing>true</enableExternalEntityProcessing>
                            </systemProperties>
                            <jvmArguments>
                                <jvmArgument>-Xms32m</jvmArgument>
                            </jvmArguments>
                            <arguments>
                                <argument>-verbose</argument>
                                <argument>-extension</argument>
                                <argument>-XtoString</argument>
                                <argument>-Xinheritance</argument>
                                <argument>-Xsetters-mode=direct</argument>
                                <argument>-d</argument>
                                <argument>${jaxws.generated.sources}</argument>
                                <argument>-b</argument>
                                <argument>${project.basedir}/src/main/resources/bindings/bindings.jxb</argument>
                                <argument>${project.basedir}/src/main/resources/xsd/qbxmlops130.xsd</argument>
                            </arguments>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

Thanks.

davidmoten commented 5 years ago

Hi, no caching has been implemented.