Is it possible to combine the capabilities of an archetype and a normal Maven plugin into a single plugin?
I have a custom language which I can compile into Java source code. I've written a Maven plugin which does this in the generate-sources phase, adds the Java source to the project, and builds the project. It works as I'd expect.
However, to use it, I need to first write out a pom.xml file referencing my plugin and describing where the input files live. I'd like to be able to go straight from raw input files to compiled code in a single maven command.
For example, suppose I have this directory structure:
my-project/ some-input-file.dsl I want to run
bash$ mvn com.waisbrot.plugin:generate -DgroupID=com.waisbrot package and after Maven's done running have:
my-project/ some-input-file.dsl pom.xml target/ generated-sources/ plugin/ SomeInputFile.java classes/ com/ waisbrot/ SomeInputFile.class some-input-file-1.0.jar