我有一个小 Java 程序,它使用Maven Invoker以编程方式运行一些 Maven 命令。Maven 例程基本上是:
InvocationRequest request = new DefaultInvocationRequest();
Invoker invoker = new DefaultInvoker();
request.setGoals(Arrays.asList("clean", "install"));
// module.pomFullPath(workspaceRoot) gets the module location
request.setPomFile(new File(module.pomFullPath(workspaceRoot)));
InvocationResult result = invoker.execute(request);
这mvn clean install
在模块上运行。现在我需要运行一个命令添加选项,promtlymvn -pl !skipThis clean install
如何在我的程序中将-pl
选项添加到我的request
对象?提前感谢您的回答/评论