0

I've been working on this all day and can't seem to find a solution to fit my requirements.

  1. Addition to compile life cycle that generates code. (I thought a MOJO would work here)
  2. MOJO depends on compiled code to generate 'new' parts.
  3. MOJO is only ever going to be required for this maven project.
  4. I cannot alter the definitions of the existing maven project which is a fully compliant maven infrastructure and packaging of jar. (So I cannot create the MOJO as a module of this)

Is there any way I can create this step as part of the maven lifecycle?

I've tried a dozen different routes and they either cause issues as I try to declare the dependency as it self and goes into an infinite loop, or if I make the MOJO as a child of the project (part of the src), I have no way to automatically compile the MOJO's project during the compilation of the main maven project.

Craig
  • 3,043
  • 8
  • 24
  • 25
  • If your compiled code can instead be a [groovy mojo](https://books.sonatype.com/mcookbook/reference/writing-plugins-alternative-sect-writing-groovy.html) you can skip step #1.. – tariksbl Apr 07 '16 at 00:58
  • 1
    You can bind your plugin to the `process-classes` life cycle phase and do what you need with the classes? Furthermore you need to make changes to your pom file cause you will execute it as part of the life cycle... – khmarbaise Apr 07 '16 at 06:35
  • @tariksbl The problem I'm having is that I need the groovy mojo or regular mojo to be a part of the Maven project that is using it. The groovy-mojo does skip the first restriction but it still has to be an external maven plugin project and that is what I am trying to avoid. If I can bind a maven project to itself with the process-classes then this would work, but from what I have seen this creates an infinite loop. – Craig Apr 11 '16 at 21:28

0 Answers0