Configure maven-exec-plugin using pom
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.1</version>
<executions>
<execution>
<phase>yourPhase</phase>
...
<goals>
<goal>java</goal>
</goals>
<configuration>
<mainClass>mainClass=org.sonatype.mavenbook.weather.Main</mainClass>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
In the line, <phase>yourPhase</phase>insert the maven phase in what this plugin should run.
pom classpath ( ). , , , exec.