You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Kallin Nagelberg <ka...@gmail.com> on 2008/01/06 00:44:12 UTC

unable to add custom ant tasks to scripts

Im trying to use the groovy-maven-plugin to execute some groovy scripts that
make use of the antbuilder. I need to be able to use the maven-ant-tasks
within this script, which I've tried to do as follows:

def mvn = NamespaceBuilder.newInstance(ant, 'antlib:
org.apache.maven.artifact.ant')

mvn.dependencies(pathId:myMvnPath){
    pom(file:"somepom.xml")
}

I've been using this approach within some groovy plugins that I've written
and it's had no problems picking up the ant tasks from the classpath.

However, when utilizing the groovy-maven-plugin within a pom with the exact
same dependencies as my plugins, I'm getting the following error:

Problem: failed to create task or type antlib:
org.apache.maven.artifact.ant:dependencies
Cause: The name is undefined.

Running dependency:resolve against both poms results in the exact same
dependencies. I am stumped about how to get this to work. Anyone have any
ideas?

Thanks!

Re: unable to add custom ant tasks to scripts

Posted by Kallin Nagelberg <ka...@gmail.com>.
Anyone?

On Jan 5, 2008 6:44 PM, Kallin Nagelberg <ka...@gmail.com> wrote:

> Im trying to use the groovy-maven-plugin to execute some groovy scripts
> that make use of the antbuilder. I need to be able to use the
> maven-ant-tasks within this script, which I've tried to do as follows:
>
> def mvn = NamespaceBuilder.newInstance(ant, 'antlib:
> org.apache.maven.artifact.ant')
>
> mvn.dependencies(pathId:myMvnPath){
>     pom(file:"somepom.xml")
> }
>
> I've been using this approach within some groovy plugins that I've written
> and it's had no problems picking up the ant tasks from the classpath.
>
> However, when utilizing the groovy-maven-plugin within a pom with the
> exact same dependencies as my plugins, I'm getting the following error:
>
> Problem: failed to create task or type antlib:
> org.apache.maven.artifact.ant:dependencies
> Cause: The name is undefined.
>
> Running dependency:resolve against both poms results in the exact same
> dependencies. I am stumped about how to get this to work. Anyone have any
> ideas?
>
> Thanks!
>