[ 
https://issues.apache.org/jira/browse/CXF-8315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17154609#comment-17154609
 ] 

thebitmuncher commented on CXF-8315:
------------------------------------

Yes I'm familiar with the <extraarg> elements occurring both for each param and 
value - I've been running it successfully like 
 that when placing the <extraargs> section under the <wsdlOption>.

 
{code:java}
<wsdlOption>
  <wsdl>${project.basedir}/src/main/resources/wsdl/MyService.wsdl</wsdl>
    <extraargs>
      <extraarg>-frontend</extraarg>
      <extraarg>cxf</extraarg>
    </extraargs> 
  <wsdlLocation>classpath:wsdl/MyService.wsdl</wsdlLocation> 
 </wsdlOption>{code}
 

 

 This creates the "cxf" version of frontend "proxy" objects that I prefer to 
use rather than the default jaxb version of generated objects.

The cxf javadocs refer to this fe "cxf" value being supported:

[https://github.com/apache/cxf/blob/master/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/wsdl2java/Option.java]

 

 
{code:java}
/**
 * Specifies the frontend. Default is JAXWS. Currently supports "JAXWS" and 
"CXF" frontends.
 */
 String frontEnd;{code}
 

 

The RedHat Fuse docs recommend using this setting and describe it:

[https://access.redhat.com/documentation/en-us/red_hat_fuse/7.2/html/apache_cxf_development_guide/jaxwsconsumerdevwsdlfirst]
{quote}"If you generate your client proxy by specifying the -fe cxf option in 
wsdl2java (thereby selecting the cxf frontend), the generated client proxy code 
is better integrated with Java 7."
{quote}
It's working fine for me with open jdk 11.

 

 I'm interested in placing the <extraargs> element within the <defaultOptions> 
element to avoid repetition of having to put <extraargs> under each 
<wsdlOption> element.

 

The cxf codegen docs look to be describing that this is supported or at least 
the intent:

[https://cxf.apache.org/docs/maven-cxf-codegen-plugin-wsdl-to-java.html]
{quote}"To avoid copy/paste in multiple <wsdlOption> you can also declare a 
<defaultOptions> element."
"<defaultOptions> and <wsdlOption> correspond to the options outlined on the 
WSDL to Java page,"
{quote}
 

 There is another user who has reported having this same issue, with an 
unresolved comment about the <defaultOptions> support:

[https://stackoverflow.com/questions/24159729/cxf-auto-generation-fails-with-duplicated-option-frontend-in-maven]
{quote}"Great, it works a wsdlOption level. But why doesn't it work at 
defaultOptions level, which is exactly the intention for this to simple define 
the extraargs and reuse it for every wsdl?"

 
{quote}

> cxf-codegen-plugin defaultOptions doesn't work with <extraargs>
> ---------------------------------------------------------------
>
>                 Key: CXF-8315
>                 URL: https://issues.apache.org/jira/browse/CXF-8315
>             Project: CXF
>          Issue Type: Bug
>          Components: Build system
>    Affects Versions: 3.3.7
>            Reporter: thebitmuncher
>            Assignee: Freeman Yue Fang
>            Priority: Major
>
> When attempting to put the "-fe cxf" property into the 
> defaultOptions/extraargs element, it adds the property mulitple times to the 
> wsdl2java command. This causes a failure with the message:
> org.apache.cxf.tools.common.toolspec.parser.BadUsageException: Duplicated 
> option: frontend
>  
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to