提问人:user2609605 提问时间:8/29/2023 更新时间:8/29/2023 访问量:22
Maven 插件:对象中的参数作为字段无法正常工作
maven plugin: parameter as field in object does not work properly
问:
我为 maven 编写了一个插件,https://github.com/Reissner/latex-maven-plugin。
它在InjectionMojo
@Parameter(name = "injections", defaultValue = "latexmkrc,chktexrc",
property = "latex.injections")
private Set<Injection> injections;`
效果很好。 我可以从命令行使用 default 和 he 属性。 命令行设置将覆盖所有设置。
然后我还有另一个参数,它是 :CfgLatexMojo
@Parameter(name = "settings")
protected Settings settings;
类本身有一个参数Settings
@Parameter(name = "targets", defaultValue = "chk,pdf,html", property = "latex.targets")//
//private SortedSet<Target> targets;
private String targets = "chk,pdf,html";
在这里,我观察到奇怪的事情:
如果我不初始化,我会得到一个,
虽然应该足够了。targets = "chk,pdf,html"
NullPointerException
defaultValue = "chk,pdf,html"
另外,该物业不起作用。或者也许我不知道如何正确调用。
还有更多奇怪的效果,但让我们先关注这些。
答: 暂无答案
评论
public setTargets(String)