You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by David Walend <dw...@alphatech.com> on 2003/06/19 17:03:19 UTC

Re: Lame newbie question - how to set target directory for the build?

Vipul,

Thanks, but I figured it out. It's not quite as good as ant's -find option, but

maven jar --find project.xml

puts things in the right place. (Odd that maven is still able to search up 
the source tree to find some project.xml file on it's own, but doesn't 
reset the base directory. Is that a bug?)

Thanks again,

Dave


At 08:56 AM 6/19/2003 +0100, you wrote:

>Dave,
>
>You need to execute all goals in the directory that your project.xml lives !
>
>Regards,
>
>Vipul
>----- Original Message -----
>From: "David Walend" <dw...@alphatech.com>
>To: <us...@maven.apache.org>
>Sent: Wednesday, June 18, 2003 8:58 PM
>Subject: Lame newbie question - how to set target directory for the build?
>
>
> > When I run "maven jar" from down inside my source code directory, the
> > target directory (containing all the build products) winds up down inside
> > my source code directory, instead of up next to my src directory.
> > http://maven.apache.org/reference/dirlayout.html implied that target would
> > be at the top, next to src.
> >
> > How can I set the target directory from a property to be ${basedir}/target
> > insead of /current dir/target?
> >
> > Thanks,
> >
> > Dave
> >
> >
> > ---------------------------------------------------------------------
> > 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: Lame newbie question - how to set target directory for the build?

Posted by David Walend <dw...@alphatech.com>.
At 11:15 AM 6/19/2003 -0400, you wrote:

>That's why you need to use ${basedir} in your file references. As far as
>I know there is no consistent way in Java to set the current working
>directory.

Jason,

Yes! That's exactly what I'm trying to do. How do I redefine what's 
currently defined as "./target" ? I need to know the name of the property 
or tag or whatever that I need to change in project.xml (or where to change 
it if it's somewhere else), to make it be "${basedir}/target" .

Thanks,

Dave





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


Re: Lame newbie question - how to set target directory for the build?

Posted by Jason van Zyl <ja...@zenplex.com>.
On Fri, 2003-06-20 at 09:57, Mark H. Wilkinson wrote:
> On Thu, 2003-06-19 at 16:15, Jason van Zyl wrote:
> > On Thu, 2003-06-19 at 11:03, David Walend wrote:
> > > (Odd that maven is still able to search up 
> > > the source tree to find some project.xml file on it's own, but doesn't 
> > > reset the base directory. Is that a bug?)
> > 
> > That's why you need to use ${basedir} in your file references. As far as
> > I know there is no consistent way in Java to set the current working
> > directory.
> 
> I think you can only set the current working directory for new processes
> created with Runtime.exec, and that only with JDK 1.3. But I guess you
> knew that.
> 
> Would it be sufficient to store a value for ${basedir} when the POM was
> read, then to prepend it to relative paths when necessary? 

That's what we attempt. It is always recommended to use ${basedir} when
any paths are used so things work especially in the context of the
reactor where you kick off in one directory and process many sub
directories.

> Plugins would
> need to be aware of when they need absolute pathnames and when they can
> manage with the text the user put in the POM, but I'd guess most uses
> should be absolute with the possible exception of diagnostic messages.

There definitely may be some inconsistencies in the plugins as some were
written before adopting the ${basedir} policy.

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

Jason van Zyl
jason@zenplex.com
http://tambora.zenplex.org

In short, man creates for himself a new religion of a rational
and technical order to justify his work and to be justified in it.
  
  -- Jacques Ellul, The Technological Society


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


Re: Lame newbie question - how to set target directory for the build?

Posted by "Mark H. Wilkinson" <mh...@kremvax.net>.
On Thu, 2003-06-19 at 16:15, Jason van Zyl wrote:
> On Thu, 2003-06-19 at 11:03, David Walend wrote:
> > (Odd that maven is still able to search up 
> > the source tree to find some project.xml file on it's own, but doesn't 
> > reset the base directory. Is that a bug?)
> 
> That's why you need to use ${basedir} in your file references. As far as
> I know there is no consistent way in Java to set the current working
> directory.

I think you can only set the current working directory for new processes
created with Runtime.exec, and that only with JDK 1.3. But I guess you
knew that.

Would it be sufficient to store a value for ${basedir} when the POM was
read, then to prepend it to relative paths when necessary? Plugins would
need to be aware of when they need absolute pathnames and when they can
manage with the text the user put in the POM, but I'd guess most uses
should be absolute with the possible exception of diagnostic messages.

-Mark.


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


Re: Lame newbie question - how to set target directory for the build?

Posted by Jason van Zyl <ja...@zenplex.com>.
On Thu, 2003-06-19 at 11:03, David Walend wrote:
> Vipul,
> 
> Thanks, but I figured it out. It's not quite as good as ant's -find option, but
> 
> maven jar --find project.xml
> 
> puts things in the right place. (Odd that maven is still able to search up 
> the source tree to find some project.xml file on it's own, but doesn't 
> reset the base directory. Is that a bug?)

That's why you need to use ${basedir} in your file references. As far as
I know there is no consistent way in Java to set the current working
directory.

> Thanks again,
> 
> Dave
> 
> 
> At 08:56 AM 6/19/2003 +0100, you wrote:
> 
> >Dave,
> >
> >You need to execute all goals in the directory that your project.xml lives !
> >
> >Regards,
> >
> >Vipul
> >----- Original Message -----
> >From: "David Walend" <dw...@alphatech.com>
> >To: <us...@maven.apache.org>
> >Sent: Wednesday, June 18, 2003 8:58 PM
> >Subject: Lame newbie question - how to set target directory for the build?
> >
> >
> > > When I run "maven jar" from down inside my source code directory, the
> > > target directory (containing all the build products) winds up down inside
> > > my source code directory, instead of up next to my src directory.
> > > http://maven.apache.org/reference/dirlayout.html implied that target would
> > > be at the top, next to src.
> > >
> > > How can I set the target directory from a property to be ${basedir}/target
> > > insead of /current dir/target?
> > >
> > > Thanks,
> > >
> > > Dave
> > >
> > >
> > > ---------------------------------------------------------------------
> > > 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
-- 
jvz.

Jason van Zyl
jason@zenplex.com
http://tambora.zenplex.org

In short, man creates for himself a new religion of a rational
and technical order to justify his work and to be justified in it.
  
  -- Jacques Ellul, The Technological Society


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