I want to print messages before I run the maven plugin and after it.
I try something like that:
<plugins>
<plugin>
<groupId>com.soebes.maven.plugins</groupId>
<artifactId>echo-maven-plugin</artifactId>
<version>0.5.0</version>
<executions>
<execution>
<id>echo-before-call-plugin</id>
<phase>compile</phase>
<goals>
<goal>echo</goal>
</goals>
<configuration>
<echos>
<echo>Before run plugin antrun.</echo>
</echos>
</configuration>
</execution>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>compile</phase>
<configuration>
<tasks>
.....
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.soebes.maven.plugins</groupId>
<artifactId>echo-maven-plugin</artifactId>
<version>0.5.0</version>
<executions>
<execution>
<id>echo-before-call-plugin</id>
<phase>compile</phase>
<goals>
<goal>echo</goal>
</goals>
<configuration>
<echos>
<echo>After run plugin antrun.</echo>
</echos>
</configuration>
</execution>
</plugin>
</plugins>
But it gets an error - in the *.pom file we can use the plugin only once.
Next I try like this:
<plugins>
<plugin>
<groupId>com.soebes.maven.plugins</groupId>
<artifactId>echo-maven-plugin</artifactId>
<version>0.5.0</version>
<executions>
<execution>
<id>echo-before-call-plugin</id>
<phase>compile</phase>
<goals>
<goal>echo</goal>
</goals>
<configuration>
<echos>
<echo>Before run plugin antrun.</echo>
</echos>
</configuration>
</execution>
<execution>
<id>echo-after-call-plugin</id>
<phase>compile</phase>
<goals>
<goal>echo</goal>
</goals>
<configuration>
<echos>
<echo>After run plugin antrun.</echo>
</echos>
</configuration>
</execution>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>compile</phase>
<configuration>
<tasks>
.....
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
There is no error but both messages are printed before runing the antrun plugin. How to force to print the first mesege before runig plugin, and second after it.