I use maven invoker to compile generated source code programmatically.
I work now inside container and I would like to avoid of embedding MAVEN as well.
Currently the code (that runs locally) generally looks like this (I simplified it a bit):
InvocationRequest request = new DefaultInvocationRequest();
request.setPomFile(new File("pom.xml"));
request.setGoals(Collections.singletonList("test"));
Invoker invoker = new DefaultInvoker();
invoker.setMavenHome(new File(System.getenv("M2_HOME")));
try {
invoker.execute(request);
} catch (MavenInvocationException e) {
e.printStackTrace();
}
I want to redirect the invoker to the MVNW (Maven wrapper) I have along with the code.
Anyone has an idea if this is possible or supported?
Thanks!