【发布时间】:2017-08-24 09:39:24
【问题描述】:
我想这样写mojo插件:
/**
* @goal write-to-fs
*/
public class WriteToFsMojo extends AbstractMojo
{
public void execute() throws MojoExecutionException
{
String relativePathToFile = "resource/my_direcory/my_file.csv"
// find `relativePathToFile` from where goal executes
// write the file using goal arguments
}
}
我想在项目特定文件中查找,例如Menu.csv 并将行从 mvn 目标参数插入到此文件中。
例如:
mvn org.apache.maven.plugins:my-plugin:write-to-fs "-Did=100" "-Dname=New Menu Item"
我感兴趣的是这种方法是否正确?可能吗?你能提供例子吗?
【问题讨论】:
标签: java maven relative-path mojo