Possible sources of problems:
- Plugin uses lock file to determine when schema files are newer than generated files. Using the the same or default lock file name causes only first xjc plugin execution is run.
- By default the destination directory is cleared. With different XSDs targeting the sub-directories of the same directory you likely get that later executions deleting previously generated sources.
<build> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>jaxb2-maven-plugin</artifactId> <configuration> <quiet>true</quiet> <verbose>false</verbose> <clearOutputDir>false</clearOutputDir> <readOnly>true</readOnly> <arguments>-mark-generated</arguments> </configuration> <executions> <execution> <id>snmp</id> <goals><goal>xjc</goal></goals> <configuration> <packageName>org.bithill.testing..config</packageName> <schemaDirectory>${schema.dir}/config</schemaDirectory> <schemaFiles>config.xsd</schemaFiles> <staleFile>${build.directory}/generated-sources/.jaxb-staleFlag-config</staleFile> </configuration> </execution> <execution> <id>app</id> <goals><goal>xjc</goal></goals> <configuration> <packageName>org.bithill.testing.app</packageName> <schemaDirectory>${schema.dir}/app</schemaDirectory> <schemaFiles>app.xsd</schemaFiles> <staleFile>${project.build.directory}/generated-sources/.jaxb-staleFlag-app</staleFile> </configuration> </execution> </executions> </plugin> </plugins> </build>