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 2007/12/21 18:11:09 UTC

current directory from module

I've written a plugin that is being used by an artifact of mine to create
some files in my project structure (outside maven, like ../../somedir...).
It all works great when I run it from the directory housing the artifact i'm
interested in, but when I attempt to make this artifact a module of another
artifact, and then run maven against that aggregating artifact, it uses the
directory of the aggregating artifact as the current directory when it goes
to package the sub-module.

I hope that makes sense. Is this a feature/bug, and how do you think I
should go about resolving it so that no matter what directory I'm in when I
execute maven, the plugin uses the same relative path. Is there a way to
obtain the artifact's root directory through the plugin api?

Re: current directory from module

Posted by Kallin Nagelberg <ka...@gmail.com>.
I figured out how to do this by passing the ${basedir} property from the pom
into my plugin. Problem solved!

On Dec 21, 2007 12:11 PM, Kallin Nagelberg <ka...@gmail.com>
wrote:

> I've written a plugin that is being used by an artifact of mine to create
> some files in my project structure (outside maven, like ../../somedir...).
> It all works great when I run it from the directory housing the artifact i'm
> interested in, but when I attempt to make this artifact a module of another
> artifact, and then run maven against that aggregating artifact, it uses the
> directory of the aggregating artifact as the current directory when it goes
> to package the sub-module.
>
> I hope that makes sense. Is this a feature/bug, and how do you think I
> should go about resolving it so that no matter what directory I'm in when I
> execute maven, the plugin uses the same relative path. Is there a way to
> obtain the artifact's root directory through the plugin api?
>