How we can copy all the files from one folder into to another by comparing all the files in that folder, if files content changed then copy the file into another project location otherwise not.
Any suggestion that which plugin that I should try with?
I am trying using maven-antrun-plugin
(version 1.7) but no success yet.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>initialize</phase>
<configuration>
<target name="main">
<ant antfile="/build.xml" target="main" />
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
<dependency>
<groupId>ant-contrib</groupId>
<artifactId>ant-contrib</artifactId>
<version>1.0b3</version>
</dependency>
</plugin>
I was able to do by using maven-antrun-plugin
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>initialize</phase>
<configuration>
<target name="build">
<ant antfile="build.xml"
target="build" />
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>ant-contrib</groupId>
<artifactId>ant-contrib</artifactId>
<version>1.0b3</version>
<exclusions>
<exclusion>
<artifactId>ant</artifactId>
<groupId>ant</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</plugin>
build.xml
<?xml version="1.0" encoding="UTF-8"?>
<project name="prospector" basedir="/" default="main">
<target name="main" depends="etc"/>
<target name="etc">
<for param="file">
<path>
<fileset
dir="etc"
includes="**/**" />
</path>
<sequential>
<var name="name" unset="true" />
<basename file="@{file}" property="name" />
<if>
<filesmatch file1="@{file}" file2="etc/${name}" />
<then>
<echo message="There is no change in ${name}" />
</then>
<else>
<echo message="There are some changes in ${name}" />
<copy
file="@{file}"
tofile="etc/${name}" overwrite="true"/>
</else>
</if>
</sequential>
</for>
</target>