Re: Instiating a Project object ( was Re: Executing Maven throughJava Webstart)

2003-07-01 Thread Paul Libbrecht
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

- 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.

Am I following the wrong route ?

Paul

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Instiating a Project object ( was Re: Executing Maven throughJava Webstart)

2003-07-01 Thread Paul Libbrecht
Paul Libbrecht wrote:
Jason van Zyl wrote:
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
Well, not even inside maven.
I attached the project.xml and the java test file I'm running... is it a 
test case ? Should I switch to cvs head ?

Thanks.

Paul
?xml version=1.0 encoding=utf-8?

project
   xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; 
   xsi:noNamespaceSchemaLocation=./maven-project.xsd

  !-- the version of maven's project object model --
  pomVersion3/pomVersion
  
  !-- a unique name for this project --
  idMavenRepoJNLP/id
  
  !-- a short but descriptive name for the project --
  nameThe JNLP connection to the Maven repository/name
  
  !-- The version of the project under development, e.g.
   1.1, 1.2, 2.0-dev --
  currentVersion0.1/currentVersion
  
  !-- details about the organization that 'owns' the project --
	organization
		nameThe ActiveMath group, DFKI and Universität des Saarlandes/name
		urlhttp://www.activemath.org//url
logohttp://www.activemath.org/~paul/tmp/MavenProjectPics/AM_Logo.png/logo
	/organization!-- FIXME: no reason to put ActiveMath URL or ? --
  
  !-- the year the project started --
  inceptionYear2001/inceptionYear
  packageorg.activemath/package
  logohttp://www.activemath.org/~paul/tmp/MavenProjectPics/LogoOMDocJDOM.png/logo
  description
The Maven repository JNLP connection is web-application that serves
JNLP descriptors (aka Java Web Start) for each maven projects making it possible
to resolve classpath-dependencies by means of project dependencies.
  /description
  !-- a short description of what the project does --
  shortDescription
The maven repository JNLP connection.
  /shortDescription

  !-- the project home page --
  urlhttp://www.activemath.org/projects/OmdocJdom//url
  issueTrackingUrlhttp://bugzilla.mathweb.org:8000//issueTrackingUrl
  !-- siteAddresswww.activemath.org/siteAddress
  siteDirectory/www/maven.apache.org/reference/plugins/examples//siteDirectory
  distributionDirectory/www/maven.apache.org/builds//distributionDirectory --

	!-- the version control repository and http url for online access
			 the connection element has the form:
			 scm:system:system specific connection string --
	repository
		connectionscm:cvs:pserver:[EMAIL PROTECTED]:/CVS/AMauthoring/projects/OmdocJdom/connection
		!-- urlhttp://cvs.apache.org/viewcvs/maven/src/plugins-build/examples//url --
	/repository

  !-- any mailing lists for the project --
  mailingLists/
  
  !-- who the developers are for the project --
  developers
   developer
  namePaul Libbrecht/name
  idpaul/id
  email[EMAIL PROTECTED]/email
  organizationThe ActiveMath group/organization
  rolesroleJava Developer/role/roles
/developer
  /developers
   contributors
/contributors

  !-- jar files the project is dependent on --
  dependencies

dependency
  idjdom/id
  versionb8/version
  /dependency

dependency
  idsax/id
  version2.0.1/version
  /dependency

dependency
  idlog4j/id
  version1.2.7/version
  /dependency
  
dependency
  idant/id
  version1.5/version/dependency
  
dependencyidmaven/idversion20030211.132709/version/dependency
dependencyidcommons-jelly/idversion20030310.073407/version/dependency
!-- leave dom4j as the first entry or the tests fail --
dependency
  iddom4j/id
  version1.4-dev-3/version
  urlhttp://www.dom4j.org//url
/dependency

dependency
  idant/id
  version1.4.1/version
  urlhttp://jakarta.apache.org/ant//url
/dependency

dependency
  idcommons-betwixt/id
  versionSNAPSHOT/version
  urlhttp://jakarta.apache.org/commons/betwixt//url
/dependency

dependency
  idcommons-digester/id
  version1.2/version
  urlhttp://jakarta.apache.org/commons/digester.html/url
/dependency

dependency
  idcommons-jelly/id
  versionSNAPSHOT/version
  urlhttp://jakarta.apache.org/commons/sandbox/jelly//url
/dependency

dependency
  idcommons-graph/id
  version0.8.1/version
  urlhttp://jakarta.apache.org/commons/sandbox/jelly//url
/dependency

dependency
  idcommons-jexl/id
  version1.0-dev/version
  urlhttp://jakarta.apache.org/commons/sandbox/jelly//url
/dependency

dependency
  idcommons-logging/id
  version1.0/version
  urlhttp://jakarta.apache.org/commons/logging.html/url
/dependency

dependency
  idjunit/id
  version3.7/version
  typetest/type
  urlhttp://junit.org//url
/dependency

dependency
  idwerkz/id
  versionSNAPSHOT/version
/dependency

!-- Runtime dependencies --
dependency
  

Re: Instiating a Project object ( was Re: Executing Maven throughJava Webstart)

2003-07-01 Thread Paul Libbrecht
Jason van Zyl wrote:
Jason van Zyl wrote:
Jason van Zyl wrote:
import org.apache.maven.MavenUtils;

File f = new File( project.xml );
Project p = MavenUtils.getProject( f );

It works perfectly fine inside Maven. You also have to define what you
mean inside Maven. Clarity is your only hope of getting an answer that
might help you.


Inside maven meant running as a unit-test the given script-bit.
And not even inside maven meant running from the command-line.
In both cases, I get an outofmemoryerror.

Paul

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]