Reputation: 3264
I wrote a maven plugin that generates Java source code based on some definition language.
The generated source code should be split up into several jar files (interfaces, implementation, etc.).
I would like to build my project containing the definition language together with the generated sources but I'm not sure what the best way is.
I thought of extending my maven plugin to generate for each jar a new maven project and add them dynamically to the current running maven build reactor.
Is it possible to add new maven projects to the build reactor while the build is running? or Could I generate new maven projects while maven is parsing the directory structure for building the reactor? (Maybe in the validate
phase?)
Does anyone have a better idea how to compile the generated maven projects in the same reactor?
Many thanks in advance
Upvotes: 1
Views: 331
Reputation: 53694
personally, i would recommend just using one project with multiple artifacts
i believe you could generate these various jars with different classifiers and then depend on them as independent resources in other maven modules/projects.
Upvotes: 1