I have a maven project which uses wsgen to generate XSD files from the compiled java classes.
The problem is that I want to add the generated files to the jar as resou
I would suggest to define the output directory for the XSD files into target/classes (may be with a supplemental sub folder which will be packaged later during the package phase into the jar. This can be achieved by using the maven-resources-plugin.
...
maven-resources-plugin
3.0.2
copy-resources
process-classes
copy-resources
${project.build.outputDirectory}
${basedir}/target/xsd-out
false
...
...
You need to take care that the resources plugin is positioned after the plugin which is used to call the wsgen part. You can also use the prepare-package phase instead to make sure the resources will be correctly packaged.