How can I tell jaxb / Maven to generate multiple schema packages?

前端 未结 9 1835
旧时难觅i
旧时难觅i 2020-11-28 03:16

Example:

       
       
           org.jvnet.jaxb2.maven2         


        
9条回答
  •  温柔的废话
    2020-11-28 03:37

    This can also be achieved by specifying stale file name for schemas and not clearing output directory. The default out put directory is automatically included in classpath which is little convenient. If we specify different output directory one has to take care of classpath to use this code in IDE. For example -

    
            
                org.codehaus.mojo
                jaxb2-maven-plugin
                1.3.1
                
                    true
                    false
                    false
                    true
                    -mark-generated
                
                
                    
                        reportingSchema
                        
                            xjc
                        
                        
                            src/main/resources/schema/r17/schemaReporting
                            
                                OCISchemaReporting.xsd
                            
                            com.broadsoft.oci.r17.reporting
                            ${build.directory}/generated-sources/.jaxb-staleFlag-reporting
                        
                    
                    
                        schemaAS
                        
                            xjc
                        
                        
                            src/main/resources/schema/r17/schemaAS
                            
                                OCISchemaAS.xsd
                            
                            com.broadsoft.oci.r17.as
                            ${build.directory}/generated-sources/.jaxb-staleFlag-as
                        
                    
                
            
    
    

    Source:Generating Code with JAXB Plugin

提交回复
热议问题