Generating XML Schema from JAXB class files in Ant
问题 Is it possible to use the shemagen ant Task to generate an xsd schema from class files instead of from source? 回答1: You could probably write something fairly easily, and then call it from Ant: import java.io.File; import java.io.IOException; import javax.xml.bind.JAXBContext; import javax.xml.bind.SchemaOutputResolver; import javax.xml.transform.Result; import javax.xml.transform.stream.StreamResult; public class SchemaGenerator { public static void main(String[] args) throws Exception {