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

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

Example:

       
       
           org.jvnet.jaxb2.maven2         


        
9条回答
  •  半阙折子戏
    2020-11-28 03:37

    You can use also JAXB bindings to specify different package for each schema, e.g.

    
    
        
            
        
    
        
            
        
    
    
    

    Then just use the new maven-jaxb2-plugin 0.8.0 and elements in the pom.xml. Or specify the top most directory in and and by your schemas and bindings:

    src/main/resources/xsd
    
        book/*.xsd
        person/*.xsd
    
    src/main/resources
    
        book/*.xjb
        person/*.xjb
    
    

    I think this is more convenient solution, because when you add a new XSD you do not need to change Maven pom.xml, just add a new XJB binding file to the same directory.

提交回复
热议问题