2 Replies Last post: Jul 5, 2012 9:44 PM by Chris Pratt  
Nathan Greenfield Newbie 1 posts since
Apr 19, 2009
Currently Being Moderated

Apr 19, 2009 9:35 PM

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

Alexander Chernikov JetBrains 1,228 posts since
Jan 11, 2007
Currently Being Moderated
Apr 20, 2009 6:15 PM in response to: Nathan Greenfield
Re: Maven Tasks for Ant

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.

Chris Pratt Newbie 19 posts since
Jun 22, 2012
Currently Being Moderated
Jul 5, 2012 9:44 PM in response to: Alexander Chernikov
Re: Maven Tasks for Ant

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*)

More Like This

  • Retrieving data ...