Maven Tasks for Ant

I've created an build.xml file relying on the Maven tasks for Ant. The build script executes correctly from the command line. However, in IDEA (8.1) the URI is highlighted in red.

<project name="My Project" default="run" basedir="."
         xmlns:artifact="antlib:org.apache.maven.artifact.ant">

What's more, the added Maven tasks are unrecognized, like this one:

  <artifact:dependencies pathId="dependency.class.path">
    <dependency groupId="log4j" artifactId="log4j" version="1.2.14"/>
  </artifact:dependencies>

Then later on IDEA doesn't recognize "dependency.class.path".

IDEA suggests that I add the resource in the project settings, but I'm at a loss. I'm unable to add a the "maven-ant-tasks-2.0.9.jar"

Any suggestions would help a ton.

Thanks!
-Nathan

2 comments

I've just answered similar questions in http://www.jetbrains.net/devnet/message/5236172

1. To resolve task names ("artifact:dependencies") you need to have antlib.xml in the classpath of your ant file. E.g. add a jar with antlib.xml to "additional classpath" property of the ant script in IDEA.

2. The error on URI is a lack of antlib support in IDEA: http://www.jetbrains.net/jira/browse/IDEADEV-36334
As a workaround you can add the URI to Settings / Resources / Ignored Resources.

3. The resolve of "dependency.class.path" could be a problem even with extended antlib support. It seems that we need to know the semantics of "pathId" attribute, but semantics cannot be investigated from the ant task introspection.

Regards,
Alexander.

0

Is this still the best we can do?  It's been three years since this original post and I'm still seeing the same problems even though the Jira ticket is marked as fixed.  What gives?
  (*Chris*)

0

Please sign in to leave a comment.