Can maven run command line instructions?

Actually there is the Exec Maven Plugin for these cases.


See exec-maven-plugin for details


Not natively.

However, by using the AntRun plugin, you can specify an Ant task (using Exec) that execute a OS command during the build.

<project>
  ...
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <phase> <!-- a lifecycle phase --> </phase>
            <configuration>
              <tasks>

                <!--
                  Place any Ant task here. You can add anything
                  you can add between <target> and </target> in a
                  build.xml.
                -->

              </tasks>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  ...
</project>

Tags:

Maven 2