Pet*_*ker 9 java parameters maven-2 maven-plugin defaults
我正在编写一个Maven插件,我正在使用所有参数的默认值,例如:
/**
* The file with the site structure.
*
* @parameter expression="${generateSite.siteFile}" default-value="${basedir}/src/oda/site.xml"
*/
private File siteFile;
Run Code Online (Sandbox Code Playgroud)
现在我要添加一个新参数,它是一个集合.有没有办法为参数设置默认值,如下所示?
/**
* A list of file/directory names to exclude in the processing.
*
* @parameter ????
*/
private Set<String> excludes;
Run Code Online (Sandbox Code Playgroud)
据我所知,这实际上是不可能的,没有真正的方法来指定具有多个值的参数类型(如数组,集合或地图)的默认值,至少不是如此parameter.我过去也必须这样做,并且在读取线程如array(或collecton)作为mojo配置参数的默认值或将列表配置为插件参数的默认值时,我最终设置了execute()方法中的默认值像克里斯的评论中提及了他的答案(例如见的Flexmojos:包装插件来源和参数参数).
| 归档时间: |
|
| 查看次数: |
4867 次 |
| 最近记录: |