I am using maven jar plugin to package the jar file. But it looks like maven jar plugin just only pack the stuff that stay inside target/classes. I am also want to pack all the classes in target/classes and (resource and class) files from many other directories. How can i do that with maven jar?
Share
If you can’t (or just don’t want to) put them under
src/main/resources, you can declare additional resource locations using the<resource>element:See Specifying resource directories.
The convention with plugins generating sources it to generate them in
target/generated-sources/<tool>and a well implemented plugin should add the specified path as a source directory (so that generated code would be compiled). When they don’t, the Build Helper Maven Plugin can come to the rescue.If you are generating classes, why don’t you generate them in
${project.build.outputDirectory}(i.e.target/classesby default)? I don’t think you can add a 2nd classes directory anyway.If this doesn’t help, please clarify your exact constraints and requirements.
References