Custom package names cxf-codegen-plugin

前端 未结 1 978
离开以前
离开以前 2021-02-01 21:33

Imagine this scenario.

I have a wsdl file with namespace a/b/c and it imports another wsdl whose namespace is m/n/o. Unfortunately, both of them have same ComplexTypes X

1条回答
  •  说谎
    说谎 (楼主)
    2021-02-01 21:53

    If you want to generate package depending on the namespace here is the solution:

    
        org.apache.cxf
        cxf-codegen-plugin
        2.6.0
        
            
                generate-sources
                generate-sources
                
                    ${basedir}/target/generated/src/main/java
                    
                        
                            yourWsdl.wsld
                            
                                -client
                                -verbose
                                -p
                                http://your.namespace/services/=your.package
                                -p
                                http://your.namespace2/services2/=your.package2
                            
                        
                    
                
                
                    wsdl2java
                
            
        
    
    

    This http://your.namespace2/services2/=your.package2 will map your namespace with the package you want.

    0 讨论(0)
提交回复
热议问题