You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Jason van Zyl <ja...@zenplex.com> on 2003/07/02 03:54:01 UTC
Re: Instiating a Project object ( was Re: Executing Maven through
Java Webstart)
On Tue, 2003-07-01 at 08:40, Paul Libbrecht wrote:
> Jason van Zyl wrote:
> >>To make that thing short, allow me a quick question: how can I
> >>instantiate a maven Project object ? Oh, and should I switch to the dev
> >>list for that ? (just fearing).
> >
> >
> > import org.apache.maven.MavenUtils;
> >
> > File f = new File( "project.xml" );
> > Project p = MavenUtils.getProject( f );
> >
>
>
> Well... doesn't sound perfect...
Huh?
> -> runing this as a test gives me an out-of-memory error, it looks like
> it's not a good idea to invoke MavenUtils.getProject(file) from within maven
It's used in Maven itself all over the place.
> -> what interests me is to have the dependencies... and what I get in
> maven.xml,
> <echo message="blop ${project.getDependencies() == null}"/>
> says true whereas the project has an amount of dependencies.
You didn't say you wanted to use it in Jelly. Please be clear.
There is a tag for using a POM in Jelly script:
<maven:pom descriptor="/path/to/descriptor"/>
But what exactly are you trying to do? Before you wander off on the
wrong road again. It's not likely you want the dependencies you probably
want the artifacts.
> Am I following the wrong route ?
>
> Paul
>
>
> ---------------------------------------------------------------------
> 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