Ant inheritance of Maven properties

I am considering converting an Ant / Ivy project to Ant / Maven-Ant -Tasks. I don’t want to use Maven myself, because I need more control over the build process.

Is there a way for the build.xml Ant properties file to inherit the properties set in the pom.xml file?

I create a generic build.xml file that can be used in several projects and download the project specific project.properties file, but it would be better if I could put all these properties into the pom.xml file.

Thank.

+3
source share
1 answer

I use the XMLProperty ant task to parse and copy these properties

http://ant.apache.org/manual/Tasks/xmlproperty.html

<xmlproperty file="<your pom location>" keepRoot="false"/>
<property name="test"   value="${properties.test}"/>

, maven Antrun ,

http://maven.apache.org/plugins/maven-antrun-plugin/usage.html

+6

Source: https://habr.com/ru/post/1767533/


All Articles