You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Kabe <ka...@robichaux.com> on 2006/10/17 00:39:42 UTC

Locating pom.xml in a parent directory?

I've searched the archives and the docs but have come up short on any
information for my issue (if i missed it, please point me to the correct
thread/doc). I'm trying to find out how to run 'mvn' in a similar way to how
i used to run 'ant', in that i was able to run it from some sub directory of
my project (for example, if i am in <project>/src/main/java/com/foo/bar) and
it will recursively check the current directory and all parent directories
until it locates the build file (pom.xml for maven of course) and then run
from that directory. Is this available with Maven? Without this, i have to
either keep a console on my project root so i can build, or move to the
project root every time i want to build. This seems like something everyone
else would come across as well, so figured there might be an option for this
type of behavior that i have just not come across. Any help would be great,
thanks.

....
Kabe

Re: Locating pom.xml in a parent directory?

Posted by Wayne Fay <wa...@gmail.com>.
I think the suggestion by Greg to see about modifying the Maven batch
file so it drills up until it finds a pom.xml and then run your Maven
command against that pom is a very reasonable one.

I'm certain it would be welcomed functionality if you coded it up and
contributed it back! ;-)

Wayne

On 10/17/06, Kabe <ka...@robichaux.com> wrote:
> Thanks Dan and Wayne for your responses. I'll figure something out for
> myself, or look at how this would be added to Maven directly. I'm very much
> an IDE style person, but i also dig into my code via a shell from time to
> time and it is a pain to have to care about where i am when i want to build
> the code. This was a real useful feature when i used Ant and something i
> thought had become sudo-standard with tools like this.
>
> ....
> Kabe
>
>
> On 10/17/06, Wayne Fay <wa...@gmail.com> wrote:
> >
> > I don't disagree with you Dan, but want to point out:
> > 1) the parentBaseDir discussion has been happening on Maven Dev and
> > not Maven Users,
> > 2) this is still very much a discussion point, far from being
> > implemented and available in a publicly-available Maven release, and
> > 3) the parentBaseDir parameter would not be helpful to this particular
> > user, based on my understanding of the use case he's presented.
> >
> > He wants to call Maven to compile his project when he's in the
> > directory /project/src/main/java/com/foo/bar, without changing
> > directories into the /project directory to execute "mvn compile" and
> > then cd'ing back to .../bar.
> >
> > I just don't want to get his hopes up... IMHO the best advice is to
> > find another "solution" to this "problem".
> >
> > Wayne
> >
> > On 10/16/06, Dan Tran <da...@gmail.com> wrote:
> > > there is some talk to provide ${parentBasedir} by maven
> > >
> > > please check the archive
> > > -D
> > >
> > > On 10/16/06, Wayne Fay <wa...@gmail.com> wrote:
> > > >
> > > > I don't believe this functionality exists. At least, I've never heard
> > > > of it being available, nor have I seen any such request on this
> > > > mailing list.
> > > >
> > > > I would perhaps create an alias to "set myvar='pwd'; cd {parent}; mvn
> > > > package; cd myvar;" or something along those lines, if you are
> > > > unable/unwilling to keep a console of your project root open all the
> > > > time.
> > > >
> > > > Wayne
> > > >
> > > > On 10/16/06, Kabe <ka...@robichaux.com> wrote:
> > > > > I've searched the archives and the docs but have come up short on
> > any
> > > > > information for my issue (if i missed it, please point me to the
> > correct
> > > > > thread/doc). I'm trying to find out how to run 'mvn' in a similar
> > way to
> > > > how
> > > > > i used to run 'ant', in that i was able to run it from some sub
> > > > directory of
> > > > > my project (for example, if i am in
> > <project>/src/main/java/com/foo/bar)
> > > > and
> > > > > it will recursively check the current directory and all parent
> > > > directories
> > > > > until it locates the build file (pom.xml for maven of course) and
> > then
> > > > run
> > > > > from that directory. Is this available with Maven? Without this, i
> > have
> > > > to
> > > > > either keep a console on my project root so i can build, or move to
> > the
> > > > > project root every time i want to build. This seems like something
> > > > everyone
> > > > > else would come across as well, so figured there might be an option
> > for
> > > > this
> > > > > type of behavior that i have just not come across. Any help would be
> > > > great,
> > > > > thanks.
> > > > >
> > > > > ....
> > > > > Kabe
> > > > >
> > > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > > For additional commands, e-mail: users-help@maven.apache.org
> > > >
> > > >
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Locating pom.xml in a parent directory?

Posted by Dan Tran <da...@gmail.com>.
Opps !!

On 10/17/06, Kabe <ka...@robichaux.com> wrote:
>
> Thanks Dan and Wayne for your responses. I'll figure something out for
> myself, or look at how this would be added to Maven directly. I'm very
> much
> an IDE style person, but i also dig into my code via a shell from time to
> time and it is a pain to have to care about where i am when i want to
> build
> the code. This was a real useful feature when i used Ant and something i
> thought had become sudo-standard with tools like this.
>
> ....
> Kabe
>
>
> On 10/17/06, Wayne Fay <wa...@gmail.com> wrote:
> >
> > I don't disagree with you Dan, but want to point out:
> > 1) the parentBaseDir discussion has been happening on Maven Dev and
> > not Maven Users,
> > 2) this is still very much a discussion point, far from being
> > implemented and available in a publicly-available Maven release, and
> > 3) the parentBaseDir parameter would not be helpful to this particular
> > user, based on my understanding of the use case he's presented.
> >
> > He wants to call Maven to compile his project when he's in the
> > directory /project/src/main/java/com/foo/bar, without changing
> > directories into the /project directory to execute "mvn compile" and
> > then cd'ing back to .../bar.
> >
> > I just don't want to get his hopes up... IMHO the best advice is to
> > find another "solution" to this "problem".
> >
> > Wayne
> >
> > On 10/16/06, Dan Tran <da...@gmail.com> wrote:
> > > there is some talk to provide ${parentBasedir} by maven
> > >
> > > please check the archive
> > > -D
> > >
> > > On 10/16/06, Wayne Fay <wa...@gmail.com> wrote:
> > > >
> > > > I don't believe this functionality exists. At least, I've never
> heard
> > > > of it being available, nor have I seen any such request on this
> > > > mailing list.
> > > >
> > > > I would perhaps create an alias to "set myvar='pwd'; cd {parent};
> mvn
> > > > package; cd myvar;" or something along those lines, if you are
> > > > unable/unwilling to keep a console of your project root open all the
> > > > time.
> > > >
> > > > Wayne
> > > >
> > > > On 10/16/06, Kabe <ka...@robichaux.com> wrote:
> > > > > I've searched the archives and the docs but have come up short on
> > any
> > > > > information for my issue (if i missed it, please point me to the
> > correct
> > > > > thread/doc). I'm trying to find out how to run 'mvn' in a similar
> > way to
> > > > how
> > > > > i used to run 'ant', in that i was able to run it from some sub
> > > > directory of
> > > > > my project (for example, if i am in
> > <project>/src/main/java/com/foo/bar)
> > > > and
> > > > > it will recursively check the current directory and all parent
> > > > directories
> > > > > until it locates the build file (pom.xml for maven of course) and
> > then
> > > > run
> > > > > from that directory. Is this available with Maven? Without this, i
> > have
> > > > to
> > > > > either keep a console on my project root so i can build, or move
> to
> > the
> > > > > project root every time i want to build. This seems like something
> > > > everyone
> > > > > else would come across as well, so figured there might be an
> option
> > for
> > > > this
> > > > > type of behavior that i have just not come across. Any help would
> be
> > > > great,
> > > > > thanks.
> > > > >
> > > > > ....
> > > > > Kabe
> > > > >
> > > > >
> > > >
> > > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > > For additional commands, e-mail: users-help@maven.apache.org
> > > >
> > > >
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
>

Re: Locating pom.xml in a parent directory?

Posted by Kabe <ka...@robichaux.com>.
Thanks Dan and Wayne for your responses. I'll figure something out for
myself, or look at how this would be added to Maven directly. I'm very much
an IDE style person, but i also dig into my code via a shell from time to
time and it is a pain to have to care about where i am when i want to build
the code. This was a real useful feature when i used Ant and something i
thought had become sudo-standard with tools like this.

....
Kabe


On 10/17/06, Wayne Fay <wa...@gmail.com> wrote:
>
> I don't disagree with you Dan, but want to point out:
> 1) the parentBaseDir discussion has been happening on Maven Dev and
> not Maven Users,
> 2) this is still very much a discussion point, far from being
> implemented and available in a publicly-available Maven release, and
> 3) the parentBaseDir parameter would not be helpful to this particular
> user, based on my understanding of the use case he's presented.
>
> He wants to call Maven to compile his project when he's in the
> directory /project/src/main/java/com/foo/bar, without changing
> directories into the /project directory to execute "mvn compile" and
> then cd'ing back to .../bar.
>
> I just don't want to get his hopes up... IMHO the best advice is to
> find another "solution" to this "problem".
>
> Wayne
>
> On 10/16/06, Dan Tran <da...@gmail.com> wrote:
> > there is some talk to provide ${parentBasedir} by maven
> >
> > please check the archive
> > -D
> >
> > On 10/16/06, Wayne Fay <wa...@gmail.com> wrote:
> > >
> > > I don't believe this functionality exists. At least, I've never heard
> > > of it being available, nor have I seen any such request on this
> > > mailing list.
> > >
> > > I would perhaps create an alias to "set myvar='pwd'; cd {parent}; mvn
> > > package; cd myvar;" or something along those lines, if you are
> > > unable/unwilling to keep a console of your project root open all the
> > > time.
> > >
> > > Wayne
> > >
> > > On 10/16/06, Kabe <ka...@robichaux.com> wrote:
> > > > I've searched the archives and the docs but have come up short on
> any
> > > > information for my issue (if i missed it, please point me to the
> correct
> > > > thread/doc). I'm trying to find out how to run 'mvn' in a similar
> way to
> > > how
> > > > i used to run 'ant', in that i was able to run it from some sub
> > > directory of
> > > > my project (for example, if i am in
> <project>/src/main/java/com/foo/bar)
> > > and
> > > > it will recursively check the current directory and all parent
> > > directories
> > > > until it locates the build file (pom.xml for maven of course) and
> then
> > > run
> > > > from that directory. Is this available with Maven? Without this, i
> have
> > > to
> > > > either keep a console on my project root so i can build, or move to
> the
> > > > project root every time i want to build. This seems like something
> > > everyone
> > > > else would come across as well, so figured there might be an option
> for
> > > this
> > > > type of behavior that i have just not come across. Any help would be
> > > great,
> > > > thanks.
> > > >
> > > > ....
> > > > Kabe
> > > >
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: users-help@maven.apache.org
> > >
> > >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Locating pom.xml in a parent directory?

Posted by Wayne Fay <wa...@gmail.com>.
I don't disagree with you Dan, but want to point out:
1) the parentBaseDir discussion has been happening on Maven Dev and
not Maven Users,
2) this is still very much a discussion point, far from being
implemented and available in a publicly-available Maven release, and
3) the parentBaseDir parameter would not be helpful to this particular
user, based on my understanding of the use case he's presented.

He wants to call Maven to compile his project when he's in the
directory /project/src/main/java/com/foo/bar, without changing
directories into the /project directory to execute "mvn compile" and
then cd'ing back to .../bar.

I just don't want to get his hopes up... IMHO the best advice is to
find another "solution" to this "problem".

Wayne

On 10/16/06, Dan Tran <da...@gmail.com> wrote:
> there is some talk to provide ${parentBasedir} by maven
>
> please check the archive
> -D
>
> On 10/16/06, Wayne Fay <wa...@gmail.com> wrote:
> >
> > I don't believe this functionality exists. At least, I've never heard
> > of it being available, nor have I seen any such request on this
> > mailing list.
> >
> > I would perhaps create an alias to "set myvar='pwd'; cd {parent}; mvn
> > package; cd myvar;" or something along those lines, if you are
> > unable/unwilling to keep a console of your project root open all the
> > time.
> >
> > Wayne
> >
> > On 10/16/06, Kabe <ka...@robichaux.com> wrote:
> > > I've searched the archives and the docs but have come up short on any
> > > information for my issue (if i missed it, please point me to the correct
> > > thread/doc). I'm trying to find out how to run 'mvn' in a similar way to
> > how
> > > i used to run 'ant', in that i was able to run it from some sub
> > directory of
> > > my project (for example, if i am in <project>/src/main/java/com/foo/bar)
> > and
> > > it will recursively check the current directory and all parent
> > directories
> > > until it locates the build file (pom.xml for maven of course) and then
> > run
> > > from that directory. Is this available with Maven? Without this, i have
> > to
> > > either keep a console on my project root so i can build, or move to the
> > > project root every time i want to build. This seems like something
> > everyone
> > > else would come across as well, so figured there might be an option for
> > this
> > > type of behavior that i have just not come across. Any help would be
> > great,
> > > thanks.
> > >
> > > ....
> > > Kabe
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Locating pom.xml in a parent directory?

Posted by Gr...@Countrywide.Com.
I don't want to discourage you from requesting a new feature, but I 
thought I'd throw my 2 cents in about workarounds. I have an external tool 
setup in eclipse to run mvn from the project root directory. I don't 
typically navigate my project's folder structure from a shell. I suspect 
you're a text editor only type to be doing a lot of that navigation 
(nothing wrong with that). If I were in your shoes, I'd probably just 
locally modify my mvn bat or shell script to keep stepping up the 
directory tree until it finds a pom.xml before actually executing. It'd be 
nice to attach that modification to the feature request.

Greg Vaughn
greg_vaughn@countrywide.com

kabriel@gmail.com wrote on 10/17/2006 03:00:32 PM:

> I don't see anything in the archives about "parentBasedir". Does 
everyone
> just run mvn from their project root directory? this seems very limiting 
and
> against the model that a lot of people that use tools like ant follow.
> 
> What is the best way to request a new feature like this?
> 
> 
> On 10/16/06, Dan Tran <da...@gmail.com> wrote:
> >
> > there is some talk to provide ${parentBasedir} by maven
> >
> > please check the archive
> > -D
> >
> > On 10/16/06, Wayne Fay <wa...@gmail.com> wrote:
> > >
> > > I don't believe this functionality exists. At least, I've never 
heard
> > > of it being available, nor have I seen any such request on this
> > > mailing list.
> > >
> > > I would perhaps create an alias to "set myvar='pwd'; cd {parent}; 
mvn
> > > package; cd myvar;" or something along those lines, if you are
> > > unable/unwilling to keep a console of your project root open all the
> > > time.
> > >
> > > Wayne
> > >
> > > On 10/16/06, Kabe <ka...@robichaux.com> wrote:
> > > > I've searched the archives and the docs but have come up short on 
any
> > > > information for my issue (if i missed it, please point me to the
> > correct
> > > > thread/doc). I'm trying to find out how to run 'mvn' in a similar 
way
> > to
> > > how
> > > > i used to run 'ant', in that i was able to run it from some sub
> > > directory of
> > > > my project (for example, if i am in
> > <project>/src/main/java/com/foo/bar)
> > > and
> > > > it will recursively check the current directory and all parent
> > > directories
> > > > until it locates the build file (pom.xml for maven of course) and 
then
> > > run
> > > > from that directory. Is this available with Maven? Without this, i
> > have
> > > to
> > > > either keep a console on my project root so i can build, or move 
to
> > the
> > > > project root every time i want to build. This seems like something
> > > everyone
> > > > else would come across as well, so figured there might be an 
option
> > for
> > > this
> > > > type of behavior that i have just not come across. Any help would 
be
> > > great,
> > > > thanks.
> > > >
> > > > ....
> > > > Kabe
> > > >
> > > >
> > >
> > > 
---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: users-help@maven.apache.org
> > >
> > >
> >
> >

======================================================================
Confidentiality Notice: The information contained in and transmitted with this communication is strictly confidential, is intended only for the use of the intended recipient, and is the property of Countrywide Financial Corporation or its affiliates and subsidiaries.  If you are not the intended recipient, you are hereby notified that any use of the information contained in or transmitted with the communication or dissemination, distribution, or copying of this communication is strictly prohibited by law.  If you have received this communication in error, please immediately return this communication to the sender and delete the original message and any copy of it in your possession.
======================================================================

Re: Locating pom.xml in a parent directory?

Posted by Kabe <ka...@robichaux.com>.
I don't see anything in the archives about "parentBasedir". Does everyone
just run mvn from their project root directory? this seems very limiting and
against the model that a lot of people that use tools like ant follow.

What is the best way to request a new feature like this?


On 10/16/06, Dan Tran <da...@gmail.com> wrote:
>
> there is some talk to provide ${parentBasedir} by maven
>
> please check the archive
> -D
>
> On 10/16/06, Wayne Fay <wa...@gmail.com> wrote:
> >
> > I don't believe this functionality exists. At least, I've never heard
> > of it being available, nor have I seen any such request on this
> > mailing list.
> >
> > I would perhaps create an alias to "set myvar='pwd'; cd {parent}; mvn
> > package; cd myvar;" or something along those lines, if you are
> > unable/unwilling to keep a console of your project root open all the
> > time.
> >
> > Wayne
> >
> > On 10/16/06, Kabe <ka...@robichaux.com> wrote:
> > > I've searched the archives and the docs but have come up short on any
> > > information for my issue (if i missed it, please point me to the
> correct
> > > thread/doc). I'm trying to find out how to run 'mvn' in a similar way
> to
> > how
> > > i used to run 'ant', in that i was able to run it from some sub
> > directory of
> > > my project (for example, if i am in
> <project>/src/main/java/com/foo/bar)
> > and
> > > it will recursively check the current directory and all parent
> > directories
> > > until it locates the build file (pom.xml for maven of course) and then
> > run
> > > from that directory. Is this available with Maven? Without this, i
> have
> > to
> > > either keep a console on my project root so i can build, or move to
> the
> > > project root every time i want to build. This seems like something
> > everyone
> > > else would come across as well, so figured there might be an option
> for
> > this
> > > type of behavior that i have just not come across. Any help would be
> > great,
> > > thanks.
> > >
> > > ....
> > > Kabe
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
>

Re: Locating pom.xml in a parent directory?

Posted by Dan Tran <da...@gmail.com>.
there is some talk to provide ${parentBasedir} by maven

please check the archive
-D

On 10/16/06, Wayne Fay <wa...@gmail.com> wrote:
>
> I don't believe this functionality exists. At least, I've never heard
> of it being available, nor have I seen any such request on this
> mailing list.
>
> I would perhaps create an alias to "set myvar='pwd'; cd {parent}; mvn
> package; cd myvar;" or something along those lines, if you are
> unable/unwilling to keep a console of your project root open all the
> time.
>
> Wayne
>
> On 10/16/06, Kabe <ka...@robichaux.com> wrote:
> > I've searched the archives and the docs but have come up short on any
> > information for my issue (if i missed it, please point me to the correct
> > thread/doc). I'm trying to find out how to run 'mvn' in a similar way to
> how
> > i used to run 'ant', in that i was able to run it from some sub
> directory of
> > my project (for example, if i am in <project>/src/main/java/com/foo/bar)
> and
> > it will recursively check the current directory and all parent
> directories
> > until it locates the build file (pom.xml for maven of course) and then
> run
> > from that directory. Is this available with Maven? Without this, i have
> to
> > either keep a console on my project root so i can build, or move to the
> > project root every time i want to build. This seems like something
> everyone
> > else would come across as well, so figured there might be an option for
> this
> > type of behavior that i have just not come across. Any help would be
> great,
> > thanks.
> >
> > ....
> > Kabe
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Locating pom.xml in a parent directory?

Posted by Wayne Fay <wa...@gmail.com>.
I don't believe this functionality exists. At least, I've never heard
of it being available, nor have I seen any such request on this
mailing list.

I would perhaps create an alias to "set myvar='pwd'; cd {parent}; mvn
package; cd myvar;" or something along those lines, if you are
unable/unwilling to keep a console of your project root open all the
time.

Wayne

On 10/16/06, Kabe <ka...@robichaux.com> wrote:
> I've searched the archives and the docs but have come up short on any
> information for my issue (if i missed it, please point me to the correct
> thread/doc). I'm trying to find out how to run 'mvn' in a similar way to how
> i used to run 'ant', in that i was able to run it from some sub directory of
> my project (for example, if i am in <project>/src/main/java/com/foo/bar) and
> it will recursively check the current directory and all parent directories
> until it locates the build file (pom.xml for maven of course) and then run
> from that directory. Is this available with Maven? Without this, i have to
> either keep a console on my project root so i can build, or move to the
> project root every time i want to build. This seems like something everyone
> else would come across as well, so figured there might be an option for this
> type of behavior that i have just not come across. Any help would be great,
> thanks.
>
> ....
> Kabe
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org