maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason van Zyl <>
Subject Re: Instiating a Project object ( was Re: Executing Maven through Java Webstart)
Date Wed, 02 Jul 2003 01:54:01 GMT
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...


> -> 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:
> For additional commands, e-mail:

Jason van Zyl

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:
For additional commands, e-mail:

View raw message