如何从antrun中检索信息回maven?
如何从 maven-antrun-plugin 获取信息返回 Maven 脚本?例如:
[...]
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<phase>test</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<exec ... resultproperty="foo">
</target>
</configuration>
</execution>
</executions>
</build>
[...]
我有兴趣稍后在 Maven 中使用这个 foo
属性。如何退出antrun
?
How can I get information from maven-antrun-plugin back to Maven script? For example:
[...]
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<phase>test</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<exec ... resultproperty="foo">
</target>
</configuration>
</execution>
</executions>
</build>
[...]
I'm interested to use this foo
property later in Maven. How to it get out of antrun
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不确定这个解决方案是否有效,但也许您可以尝试一下:
这个想法是通过使用
定义一个可用于 Maven 的属性(此处称为
.我在这里使用 JavaScript,因此您需要在foo.mvn
) project.setProperty("foo.mvn", ${foo});antrun
插件中添加一些依赖项才能运行它...I am not sure if this solution will work, but maybe you can give it a try:
The idea is to use define a property available for Maven (called here
foo.mvn
) by using theproject.setProperty("foo.mvn", ${foo});
. I am using JavaScript here, so you need to add some dependencies in theantrun
plugin to be able to run it...