Thanks.
I think I am going to feel like a fool

If this works as I want it to.

import org.apache.maven.cli.MavenCli;
import java.io.File;
/**
* @author Mariusz Smykula
*/
public class MavenClient {
public static void main(String[] args) {
System.out.println(new File(".").getAbsolutePath());
MavenCli cli = new MavenCli();
cli.doMain(new String[]{"clean", "install"}, ".", System.out, System.out);
}
}

https://github.com/mariuszs/maven-cli-example/blob/master/src/main/java/MavenClient.java

On Sun, 28 Mar 2021, 09:05 Markus KARG, <[email protected]> wrote:

> Yes, there is an API to embed Maven.
> -Markus
>
>
> -----Ursprüngliche Nachricht-----
> Von: Som Lima [mailto:[email protected]]
> Gesendet: Sonntag, 28. März 2021 06:26
> An: [email protected]
> Betreff: Running maven from inside JVM.
>
> Hi,
>
> Is it possible to run maven from inside JVM ?
>
> i.e.
>
> Java -jar maven.jar --pom:/home/project/pom.xml  --goals:clean install
> package
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to