20080510 Saturday May 10, 2008

Issues with AntRun Plugin and Maven I started seeing the following error today when using Maven and the AntRun Plugin.

[INFO] [antrun:run {execution: default}]
[INFO] Executing tasks
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error executing ant tasks
	
Embedded error: java.lang.IllegalAccessError: tried to access method 
org.apache.tools.ant.launch.Locator.decodeUri(Ljava/lang/String;)Ljava/lang/String; 
from class org.apache.tools.ant.AntClassLoader

Searching the internet provided no results, so I was pretty stumped - especially since this error didn't happen on my MacBook Pro. It happened on AppFuse's Bamboo server (Linux), but not locally. Luckily, I was able to reproduce it on my Windows box and discovered the solution: upgrade to a newer version of Maven. I was using 2.0.6/2.0.7 and upgrading to 2.0.9 fixed the problem.

BTW, when is the Ant project going to release a new version of Ant? The current 1.7.0 version doesn't support spaces in path names, which seems like a pretty big issue to me (especially for Windows users). Posted in Java at May 10 2008, 06:23:26 PM MDT 4 Comments

Comments:

Interesting, I'll bet it was the new lockdown of plugin versions in the SuperPOM that fixed things. Are you running against any plugin snapshot repositories? See http://tinyurl.com/6mrhxw

Posted by Tim O'Brien on May 10, 2008 at 07:49 PM MDT #

I don't know what caused it, it's a pretty strange issue. I haven't changed my version of the maven-antrun-plugin in over a year and it used to work fine with 2.0.6 and 2.0.7.

Posted by Matt Raible on May 10, 2008 at 07:52 PM MDT #

In the past I had some errors with maven too, some of them just looked ridiculous. But when I upgraded from 2.0.7 to 2.0.8 those errors were gone. After that time I always check for new maven versions periodically :)

Posted by Eduardo Burgos on May 16, 2008 at 08:14 AM MDT #

I had the same problem running the integration-test of the Appfuse web module with the Maven plugin for Eclipse 3.3.1.1 (m2eclipse). The Eclipse plugin uses the 2.1-Snapshot version of Maven. It seems to be a issue due to the different releases of Ant used by Eclipse 3.3 ( including Ant 1.7 as plugin ) and Appfuse ( using Ant 1.6.5 ).

Commenting out the classpath refid of the taskdef fixed the problem:

  <taskdef resource="webtest_base_relaxed.taskdef">
    <!-- <classpath refid="maven.test.classpath"/> -->
  </taskdef>

Posted by Gianni Salvagno on June 06, 2008 at 06:07 AM MDT #

Post a Comment:
  • HTML Syntax: Allowed