-2

我有一个小 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对象?提前感谢您的回答/评论

4

1 回答 1

1

这是你的朋友:

InvocationRequest setProjects(List<String> projects)
于 2020-03-05T20:03:54.537 回答