Reputation: 6612
I have a project that is calling a maven plugin (open-api-generator) to make a build based on an api specification. I don't want to share the project but I'd like to create a jar that somewhat simulate a "mvn compile" using an internal maven pom.xml.
Is this possible?
Upvotes: 2
Views: 873
Reputation: 2694
Code :
MavenCli obj = new MavenCli();
obj.doMain(new String[]{"compile"}, "project_dir", System.out, System.out);
P
Add :
dependencies in your pom.xml.
Upvotes: 1
Reputation: 443
Programatically it is possible to call the Shell command. For example with:
ProcessBuilder processBuilder = new ProcessBuilder();
processBuilder.command("bash", "-c", "mvn compile /foo/bar");
Upvotes: 0