3
我正在尝试开发一个maven插件,并且在使用@Parameter注释时它不起作用。无法在maven插件上使用注释设置参数
我的依赖关系:
...
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>3.2.3</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
<version>3.3</version>
</dependency>
...
当我使用:
@Parameter (property = "resources")
protected String resources;
资源被保留为空,当我改变它:
/**
* @parameter expression="${resources}"
*/
protected String resources;
资源得到满足。我执行我的插件为:
mvn example:goal -Dresources=whatever
这是我的魔声明:
@Mojo(name = "example", defaultPhase = LifecyclePhase.PROCESS_RESOURCES)
public class ExampleMojo extends AbstractMojo {
任何想法,为什么发生这种情况和我有什么做的就是这个注解按预期工作?
你能告诉你的全POM文件? – khmarbaise 2014-10-29 07:53:39
嗨@khmarbaise我发现了这个问题。我发布它。感谢您的帮助。 – 2014-10-29 11:30:15