蚂蚁Maven的继承性 [英] Ant inheriting Maven properties
问题描述
我正在考虑一个Ant /常春藤项目转换到Ant / Maven的蚂蚁任务。我不想本身,因为我需要在构建过程中更多的控制使用Maven。
I am considering converting an Ant/Ivy project to Ant/Maven-Ant-Tasks. I do not want to use Maven by itself because I need more control over the build process.
有没有办法为Ant build.xml文件的属性继承在pom.xml文件中设置?
Is there any way for the Ant build.xml file inherit properties set in the pom.xml file?
我一直在创造,可以跨多个项目使用,并加载特定的项目的project.properties文件的通用build.xml文件,但它会更好,如果我可以把所有这些属性中的pom.xml文件
I have been creating a generic build.xml file that can be used across several projects and loads a project-specific project.properties file, but it would be nicer if I could put all of those properties in the pom.xml file.
感谢。
推荐答案
我用的是XMLProperty中Ant任务解析和复制这些属性。
I use the XMLProperty ant task to parse and copy those properties
<一个href=\"http://ant.apache.org/manual/Tasks/xmlproperty.html\">http://ant.apache.org/manual/Tasks/xmlproperty.html
<xmlproperty file="<your pom location>" keepRoot="false"/>
<property name="test" value="${properties.test}"/>
另一种选择,如果你使用Maven插件Antrun运行构建,属性将在构建文件中使用
Another option, if you use the maven Antrun plugin to run the build, the properties will be available to use in the build file
<一个href=\"http://maven.apache.org/plugins/maven-antrun-plugin/usage.html\">http://maven.apache.org/plugins/maven-antrun-plugin/usage.html
这篇关于蚂蚁Maven的继承性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!