0

I'm having trouble getting the antrun plugin to run.

I have this configuration in my pom:

<project>
    ...
    <build>
        ...
        <plugins>       
            ...
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.4</version>
                <executions>
                    <execution>
                        <phase>compile</phase>
                        <goals><goal>run</goal></goals>
                        <configuration>
                            <target>
                                <echo message="Hello, maven"/>
                            </target>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>

When I run mvn:compile it runs but all I see in the logs about the antrun plugin is this:

[INFO] --- maven-antrun-plugin:1.4:run (default) @ datasite-cms ---
project.artifactId
[INFO] Executing tasks
[INFO] Executed tasks

Why isn't the plugin actually doing anything?

Dave Newton
  • 158,873
  • 26
  • 254
  • 302
David
  • 14,569
  • 34
  • 78
  • 107
  • Why do you need to use maven-antrun-plugin? What is the purpose ? – khmarbaise May 19 '15 at 06:34
  • To run sencha command's build tools from maven. – David May 19 '15 at 14:57
  • Also @khmarbaise, is there some reason why I shouldn't use the antrun plugin? – David May 19 '15 at 15:01
  • I made often the experience that users don't know which plugins exists...which is most of the time simpler than using maven-antrun-plugin...but there exist some situations where you can't avoid maven-antrun-plugin... – khmarbaise May 19 '15 at 15:31

1 Answers1

2

Please use an uptodate version of the maven-antrun-plugin if you really need to use maven-antrun-plugin.

The older versions have using the configuration tag: tasks instead of target. But stop using such ancient versions of Maven plugins.

khmarbaise
  • 92,914
  • 28
  • 189
  • 235
  • Yep. This is exactly what I was doing wrong. I didn't even realize that I was using an old version. Thank you for your help. – David May 19 '15 at 19:06
  • 1
    The uptodate list of maven plugins can be found here: http://maven.apache.org/plugins/ – khmarbaise May 19 '15 at 20:37