patrodyne / hisrc-basicjaxb

XJC plugins and tools for JAXB.
BSD 3-Clause "New" or "Revised" License
16 stars 6 forks source link

-XvalueConstructor fails with cxf-codegen-plugin #6

Closed famod closed 1 year ago

famod commented 1 year ago

First off: Thanks for keeping those plugins alive in the jakarta world!

For some strange reason, I can use hisrc-hyperjaxb-annox-plugin via cxf-codegen-plugin just fine but I fail to use the ValueConstructor plugin from this repo.

plugin config:

<plugin>
    <groupId>org.apache.cxf</groupId>
    <artifactId>cxf-codegen-plugin</artifactId>
    <version>${cxf-codegen-plugin.version}</version>
    <configuration>
        <additionalJvmArgs>-Djavax.xml.accessExternalDTD=file</additionalJvmArgs>
        <defaultOptions>
            <extraargs>
                <extraarg>-mark-generated</extraarg>
            </extraargs>
            <xjcargs>
                <xjcarg>-readOnly</xjcarg>
                <xjcarg>-XvalueConstructor</xjcarg>
                <xjcarg>-Xannotate</xjcarg>
            </xjcargs>
        </defaultOptions>
        <disableDirectoryScan>true</disableDirectoryScan>
        <sourceRoot>${project.build.directory}/generated-sources/webservice/</sourceRoot>
    </configuration> 
    <dependencies>
        <dependency>
            <groupId>org.patrodyne.jvnet</groupId>
            <artifactId>hisrc-basicjaxb-plugins</artifactId>
            <version>2.1.0</version>
        </dependency>
        <dependency>
            <groupId>org.patrodyne.jvnet</groupId>
            <artifactId>hisrc-hyperjaxb-annox-plugin</artifactId>
            <version>2.1.0</version>
        </dependency>
    </dependencies>
</plugin>

(actual wsdl config omitted)

error:

[WARNING] Exception in thread "main" org.apache.cxf.tools.common.ToolException: XJC reported 'BadCommandLineException' for -xjc argument:-extension -readOnly -XvalueConstructor -Xannotate 
[WARNING] 
[WARNING] Available plugin options:
[WARNING]   -Xjaxbindex        : generate per-package jaxb.index file
[WARNING]   -XtoString         :  generate reflection-free 'toString' methods
[WARNING]   -Xequals           :  generates reflection-free 'equals' methods
[WARNING]   -XhashCode         :  generates reflection-free 'hashCode' methods
[WARNING]   -Xcopyable         :  generates reflection-free deep copying
[WARNING]   -Xmergeable        :  generate reflection-free methods to merge data from two objects into a target object
[WARNING]   -Xinheritance      :  makes schema-derived classes extend certain class or implement certain interfaces
[WARNING]   -Xsetters          :  generates setters for collections.
[WARNING]   -Xwildcard         :  specify the wildcard mode for wildcard properties.
[WARNING]   -XautoInheritance  :  automatically extend global elements / complex types from a class or interface
[WARNING]   -XelementWrapper   :  generates @XmlElementWrapper annotations
[WARNING]   -Xsimplify         :  simplifies 'choice' properties like fooOrBarOrBaz
[WARNING]   -XsimpleHashCode   :  generate reflection-free runtime-free 'hashCode' methods
[WARNING]   -XsimpleEquals     :  generate reflection-free runtime-free 'equals' methods
[WARNING]   -XsimpleToString   :  generate reflection-free runtime-free 'toString' methods
[WARNING]   -XenumValue        :  generated @XmlEnums implement org.jvnet.basicjaxb.lang.EnumValue<T> interface
[WARNING]   -XfixJAXB1058      :  Fixes JAXB-1058 (see https://github.com/highsource/jaxb2-basics/issues/14)
[WARNING]   -Xcustomizations   :  reads and adds customizations from files
[WARNING]   -Xinject-code       :  inject specified Java code fragments into the generated code
[WARNING]   -Xlocator           :  enable source location support for generated code
[WARNING]   -Xsync-methods      :  generate accessor methods with the 'synchronized' keyword
[WARNING]   -mark-generated     :  mark the generated code as @jakarta.annotation.Generated
[WARNING]                       -noDate            : do not add date
[WARNING]                       -Xann <annotation> : generate <annotation> instead of @jakarta.annotation.Generated
[WARNING]   -episode <FILE>     :  generate the episode file for separate compilation
[WARNING]   -Xpropertyaccessors :  Use XmlAccessType PROPERTY instead of FIELD for generated classes
[WARNING] Add or remove arbitrary annotations to/from generated sources.
[WARNING] TBD
[WARNING] 
[WARNING]   at org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:426)
[WARNING]   at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.generateTypes(WSDLToJavaContainer.java:711)
[WARNING]   at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaContainer.java:259)
[WARNING]   at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:156)
[WARNING]   at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:402)
[WARNING]   at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:105)
[WARNING]   at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:113)
[WARNING]   at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:86)
[WARNING]   at org.apache.cxf.maven_plugin.wsdl2java.ForkOnceWSDL2Java.main(ForkOnceWSDL2Java.java:51)
[WARNING] Caused by: com.sun.tools.xjc.BadCommandLineException: unrecognized parameter -XvalueConstructor
[WARNING]   at com.sun.tools.xjc.Options.parseArguments(Options.java:856)
[WARNING]   at org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:410)
[WARNING]   ... 8 more

I got that -XvalueConstructor from here.

Any hints?

famod commented 1 year ago

Was it not part of 2.1.0? https://github.com/patrodyne/hisrc-basicjaxb/blob/2.1.0/plugins/src/main/java/org/jvnet/basicjaxb/plugin/valueconstructor/ValueConstructorPlugin.java

mickroll commented 1 year ago

grafik

Jep, is not part of 2.1.0. @patrodyne A new release containing this would be awesome!

patrodyne commented 1 year ago

As observed, the XvalueConstructor option is not in v2.1.0. It will be included in the next release. Releases occur on my comfort level which is non-chronological. đŸ˜‰

ammachado commented 1 year ago

Can you release a new version with this plug-in?

patrodyne commented 1 year ago

My non-chronological release level is reaching a "go" condition. Thank you for your patience and stay tuned. :wink:

marinkobabic commented 1 year ago

When do you think you will have the release ready? Just that we can plan properly. Many thanks.

patrodyne commented 1 year ago

I prefer to avoid chronological estimates. But, I am in a pre-release mode.

marinkobabic commented 1 year ago

@patrodyne do you need any support? Releasing process should usually be automated and should usually take couple of minutes. Your pre release mode lasts now already 5 days. If I can help somehow, so please let me know.

patrodyne commented 1 year ago

By "pre release mode", I was speaking figuratively. My own general review of grokness before proceeding. Thanks for your offer but things are proceeding, accordingly.

marinkobabic commented 1 year ago

@patrodyne I think you have done a great job so far. Also your current code seems to cover all the features of highsource used by us. So I have decided because of your comments here https://github.com/highsource/jaxb2-basics/issues/162 to do the migration to your fork. Unfortunately the latest released version does not contain all the features and that is the reason I'm blocked in completing the migration.

I have no idea if your release mode will take days, weeks, or months. Any indication would be appreciated even if you don't prefer to do chronological estimates. I have the pressure to do the estimates, but therefore your support is needed.

famod commented 1 year ago

Tested successfully with 2.1.1, thanks a lot @patrodyne!