Maven2 Ant Plugin cannot be found
January 15, 2008
If you use Maven 2, and have been trying to use the Maven 2 Ant plugin (“mvn ant:ant“), you may have been getting the following error:
The plugin 'org.apache.maven.plugins:maven-ant-plugin' does not exist or no valid version could be found
A quick check, however, at the Maven 2 Plugin Repository shows that the maven-ant-plugin is right there. However, the latest published version is version 2.0 and for some strange reason (at least on my end) Maven doesn’t pick it up.
There is a workaround. Apparently, you can specify the full plug-in groupId, artifactId and version as mentioned in here in the maven-users mailing list. So you could go:
mvn org.apache.maven.plugins:maven-ant-plugin:2.0:ant
Better yet, simply configure the plugin through in your project’s pom.xml:
<build>
<plugins>
...
<plugin>
<artifactId>maven-ant-plugin</artifactId>
<version>2.0</version>
</plugin>
...
</plugins>
...
</build>
(Note that the plugin groupId, when not specified, defaults to org.apache.maven.plugins which is correct, in this case.)
That should let you do mvn ant:ant again any time!
March 4, 2008 at 2:03 pm
Hi Alistair, I stumbled upon your blog and I’m glad that you’re using Maven. If you find yourself in a bind on Maven stuff please feel free to get in touch with the Exist guys. BTW, I’d like to discuss with you re some RUG activities we have in mind. Please drop me an email. ttyl.