Run a Ant task in Maven only if a property is set
My pom.xml is running an Ant task to deploy a file using FTP. However, this deployment must be only done if the -Dftp=true argument is given in the Maven command (i.e. mvn clean install -Dftp=true ). Thus, I wrote the following code: <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-antrun-plugin</artifactId> <version>1.2</version> <executions> <execution> <phase>package</phase> <goals> <goal>run</goal> </goals> <configuration> <tasks if="ftp"> <echo message="Deploying files through FTP..."/> ... </tasks> </configuration> </execution> </executions> Using