Your main problem is that you are using the src/main/java
as <outputDirectory>
. There are two major problems with that.
- The generated sources will be in a directory structure that under normal circumstances is under version control. What will you do with the generated sources? Should they be checked in? Your VCS will be signalling that new files have been found that are still not added.
- The generated sources will not be deleted when you call
mvn clean
.
You should remove the <outputDirectory>src/main/java</outputDirectory>
completely and let maven and the plugin to their job.
If you remove those lines you will have the sources generated into target/generated-sources
and they will be compiled during the compile
phase which I assume is what you want.
Regarding the reversed package name I believe you should change targetNamespace
to this:
<xsd:schema targetNamespace="http://www.test.com/jaxb/model"
...