2

I'm working on a Maven project that injects and runs some tests in another Maven projects. I already managed to inject them, however, I'm struggling to programmatically compile the other Maven project given its path. I tried Java Compiler API and Maven Compiler API but couldn't manage to do so.

Does any one know any way to programmatically compile a Maven project given its path from another Maven project?

OBezzad
  • 145
  • 1
  • 9

1 Answers1

1

I am not aware of direct API calls. Yet I think your goal is achievable, and it would come with the advantage of separating JVMs...

Make 'another Maven project' excecute a command that essentially calls maven to compile 'a Maven project'. If need be, use the AntRun Plugin and Ant's exec task for this.

Queeg
  • 7,748
  • 1
  • 16
  • 42