Re: Instiating a Project object ( was Re: Executing Maven throughJava Webstart)
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]
Re: Instiating a Project object ( was Re: Executing Maven throughJava Webstart)
On Tue, 2003-07-01 at 09:12, Paul Libbrecht wrote: > 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 ? 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. > > Thanks. > > Paul > > __ > > > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; >xsi:noNamespaceSchemaLocation="./maven-project.xsd"> > > > 3 > > > MavenRepoJNLP > > > The JNLP connection to the Maven repository > > > 0.1 > > > > The ActiveMath group, DFKI and Universität des Saarlandes > http://www.activemath.org/ > http://www.activemath.org/~paul/tmp/MavenProjectPics/AM_Logo.png > > > > 2001 > org.activemath > http://www.activemath.org/~paul/tmp/MavenProjectPics/LogoOMDocJDOM.png > > 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. > > > > The maven repository JNLP connection. > > > > http://www.activemath.org/projects/OmdocJdom/ > http://bugzilla.mathweb.org:8000/ > > > > > scm:cvs:pserver:[EMAIL > PROTECTED]:/CVS/AMauthoring/projects/OmdocJdom > > > > > > > > > > Paul Libbrecht > paul > [EMAIL PROTECTED] > The ActiveMath group > Java Developer > > > > > > > > > > jdom > b8 > > > > sax > 2.0.1 > > > > log4j > 1.2.7 > > > > ant > 1.5 > > maven20030211.132709 > commons-jelly20030310.073407 > > > dom4j > 1.4-dev-3 > http://www.dom4j.org/ > > > > ant > 1.4.1 > http://jakarta.apache.org/ant/ > > > > commons-betwixt > SNAPSHOT > http://jakarta.apache.org/commons/betwixt/ > > > > commons-digester > 1.2 > http://jakarta.apache.org/commons/digester.html > > > > commons-jelly > SNAPSHOT > http://jakarta.apache.org/commons/sandbox/jelly/ > > > > commons-graph > 0.8.1 > http://jakarta.apache.org/commons/sandbox/jelly/ > > > > commons-jexl > 1.0-dev > http://jakarta.apache.org/commons/sandbox/jelly/ > > > > commons-logging > 1.0 > http://jakarta.apache.org/commons/logging.html > > > > junit > 3.7 > test > http://junit.org/ > > > > werkz > SNAPSHOT > > > > > commons-beanutils > SNAPSHOT > http://jakarta.apache.org/commons/ > > > > commons-cli > SNAPSHOT > http://jakarta.apache.org/commons/cli/ > > > > commons-collections > 2.0 > http://jakarta.apache.org/commons/ > > > > commons-grant > 1.0-b1 > http://jakarta.apache.org/commons/sandbox/grant/ > > > > commons-io > 0.2-dev.20020614.122300 > http://jakarta.apache.org/commons/ > > > > commons-lang > 1.0-b1 > http://jakarta.apache.org/commons/ > > > > commons-util > 1.0-rc2-dev > http://jakarta.apache.org/commons/ > > > > forehead > 1.0-beta-4 > http://forehead.sf.net/ > > > > logkit > 1.0.1 > > > > log4j > 1.1.3 > http://jakarta.apache.org/log4j/ > > > > which > 1.0 > > > > - > > xml-apis > 2.0.2 > http://xml.apache.org/xerces2-j/ > > >xerces2.2.1 > > > > > > > > ${basedir}/src/java > ${basedir}/src/test > > > > **/Test*.java > > > > > > > maven-jdepend-plugin > > > maven-javadoc-plugin > > > maven-tasklist-plugin > maven-linkcheck-plugin > maven-jxr-plugin > > > > > > __
Re: Instiating a Project object ( was Re: Executing Maven throughJava 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, > >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: 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: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] -- jvz. Jason van Zyl [EMAIL PROTECTED] 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Instiating a Project object ( was Re: Executing Maven throughJava Webstart)
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 http://www.w3.org/2001/XMLSchema-instance"; xsi:noNamespaceSchemaLocation="./maven-project.xsd"> 3 MavenRepoJNLP The JNLP connection to the Maven repository 0.1 The ActiveMath group, DFKI and Universität des Saarlandes http://www.activemath.org/ http://www.activemath.org/~paul/tmp/MavenProjectPics/AM_Logo.png 2001 org.activemath http://www.activemath.org/~paul/tmp/MavenProjectPics/LogoOMDocJDOM.png 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. The maven repository JNLP connection. http://www.activemath.org/projects/OmdocJdom/ http://bugzilla.mathweb.org:8000/ scm:cvs:pserver:[EMAIL PROTECTED]:/CVS/AMauthoring/projects/OmdocJdom Paul Libbrecht paul [EMAIL PROTECTED] The ActiveMath group Java Developer jdom b8 sax 2.0.1 log4j 1.2.7 ant 1.5 maven20030211.132709 commons-jelly20030310.073407 dom4j 1.4-dev-3 http://www.dom4j.org/ ant 1.4.1 http://jakarta.apache.org/ant/ commons-betwixt SNAPSHOT http://jakarta.apache.org/commons/betwixt/ commons-digester 1.2 http://jakarta.apache.org/commons/digester.html commons-jelly SNAPSHOT http://jakarta.apache.org/commons/sandbox/jelly/ commons-graph 0.8.1 http://jakarta.apache.org/commons/sandbox/jelly/ commons-jexl 1.0-dev http://jakarta.apache.org/commons/sandbox/jelly/ commons-logging 1.0 http://jakarta.apache.org/commons/logging.html junit 3.7 test http://junit.org/ werkz SNAPSHOT commons-beanutils SNAPSHOT http://jakarta.apache.org/commons/ commons-cli SNAPSHOT http://jakarta.apache.org/commons/cli/ commons-collections 2.0 http://jakarta.apache.org/commons/ commons-grant 1.0-b1 http://jakarta.apache.org/commons/sandbox/grant/ commons-io 0.2-dev.20020614.122300 http://jakarta.apache.org/commons/ commons-lang 1.0-b1 http://jakarta.apache.org/commons/ commons-util 1.0-rc2-dev http://jakarta.apache.org/commons/ forehead 1.0-beta-4 http://forehead.sf.net/ logkit 1.0.1 log4j 1.1.3 http://jakarta.apache.org/log4j/ which 1.0 - xml-apis 2.0.2 http://xml.apache.org/xerces2-j/ xerces2.2.1 ${basedir}/src/java ${basedir}/src/test **/Test*.java maven-jdepend-plugin maven-javadoc-plugin maven-tasklist-plugin maven-linkcheck-plugin maven-jxr-plugin package org.activemath.author.webstart.mavenrepojnlp; import org.apache.maven.project.Project; import org.apache.maven.MavenUtils; import java.io.File; public class TestRepo extends junit.framework.TestCase { public TestRepo(String name) { super(name); } public void setUp() { } public void tearDown() { } public void testMakeAProject() throws Exception { File file = new File("project.xml"); System.out.println("Creating a project object from " + file ); Project p = MavenUtils.getProject( file ); System.out.println("Have found the project " + p); System.out.println("Dependency-classpath is " + p.getDependencyClasspath()); } public static void main(String[] args) throws Exception { TestRepo t = new TestRepo("from main"); t.testMakeAProject(); } } // class TestRepo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Instiating a Project object ( was Re: Executing Maven throughJava Webstart)
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, 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)
On Mon, 2003-06-30 at 04:00, Paul Libbrecht wrote: > Paul Libbrecht wrote: > > I was thinking about writing a servlet that would accept as parameters a > > project name and version, as well as a main-class and invocation > > attribute. The result would be a jnlp file referring a jar served from > > the maven repository (probably following the repository chain defined in > > the associated maven) with references to jnlp-described > > project-dependencies and their jar(s). > > 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 ); > Paul > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] -- jvz. Jason van Zyl [EMAIL PROTECTED] 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Instiating a Project object ( was Re: Executing Maven throughJava Webstart)
On Mon, 2003-06-30 at 10:00, Paul Libbrecht 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). Most (all?) developers are subscribed to maven-user as well... -- Martin Skopp Riege Software International GmbH Support: mailto:[EMAIL PROTECTED], Information: http://www.riege.com This email is intended to be viewed with a nonproportional font. Public Key on http://www.keyserver.net, Key-ID: 3D4027B5 Fingerprint: 1970 C78D 9A1D 99FA 5CE4 5C0D 29E6 6A95 3D40 27B5 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]