Can anyone give a good example of using org.apache.maven.cli.MavenCli programmatically?

Yeah, the’s not much in the way of documentation of MavenCli. The API is significatly simpler but i’d still like some examples. Here’s one that works…

MavenCli cli = new MavenCli();
int result = cli.doMain(new String[]{"compile"},
        "/home/aioffe/workspace/MiscMaven",
        System.out, System.out);
System.out.println("result: " + result);

It takes a dir and runs the ‘compile’ phase…

Leave a Comment