L
L
Light7772020-08-28 07:53:33
Java
Light777, 2020-08-28 07:53:33

How to generate constructor in maven-jaxb2-plugin?

I generate classes using the org.jvnet.jaxb2.maven2 plugin. Everything was generated with getters-setters, but without a constructor.
How to add constructors to generation?
Below I tried to add different settings to args, but they do not work

<plugin>
            <groupId>org.jvnet.jaxb2.maven2</groupId>
            <artifactId>maven-jaxb2-plugin</artifactId>
            <version>0.13.2</version>
            <executions>
                <execution>
                    <goals>
                        <goal>generate</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <generatePackage>com.tsb.cbsbusws.schemas.domesticpayments</generatePackage>
                <generateDirectory>${project.basedir}/src/main/java</generateDirectory>
                <schemaDirectory>${project.basedir}/src/main/resources/wsdl/domesticpayments</schemaDirectory>
                <schemaIncludes>
                    <include>*.wsdl</include>
                </schemaIncludes>
                <args>
                    <!-- part 1       не работает               -->
                    <arg>-Ximmutable</arg>
                        <arg>-fake=n</arg>
                        <arg>-overrideCollectionClass=null</arg>
                        <arg>-constructorAccess=public</arg>
                    <!--                        -->

                    <!-- part 2            не работает             -->
                        <arg>-B-Xequals</arg>
                        <arg>-B-XhashCode</arg>
                        <arg>-B-Xvalue-constructor</arg>
                    <!--                        -->


                    <arg>-XautoNameResolution</arg>
                </args>
            </configuration>
            <dependencies>
                <dependency>
                    <groupId>org.jvnet.jaxb2_commons</groupId>
                    <artifactId>jaxb2-value-constructor</artifactId>
                    <version>3.0</version>
                </dependency>
                <dependency>
                    <groupId>org.jvnet.jaxb2_commons</groupId>
                    <artifactId>jaxb2-basics</artifactId>
                    <version>0.6.2</version>
                </dependency>
            </dependencies>
        </plugin>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question