What is the difference between phases and goals in maven?
I would like to explain the difference with an example:
Imagine you need an ant task (like copying files) and you want to do this task on every call of
For this it is necessary to bind the goal ‘run’ from the maven-ant plugin to the phase ‘install’ of the maven lifecycle:
<build> <plugins> <plugin> <artifactId>maven-antrun-plugin</artifactId> <executions> <execution> <phase>install</phase> <configuration> <tasks> <copy file="fromfile" todir="todirectory" /> </tasks> </configuration> <goals> <goal>run</goal> </goals> </execution> </executions> </plugin> </plugins> </build>