Re: DefaultProjectBuilder ... mavenTools: null [Was: Re: Programmatically get maven properties]

2014-01-07 Thread Barrie Treloar
On 8 January 2014 09:00, juliangeo wrote: > Hi! > > I'm new to Maven and I've been struggling with this for a while. I just need > to be able to programmatically build a project from a pom file in order to > retrieve its relevant information. I am not using, nor want to, a maven > plugin, just nee

Re: DefaultProjectBuilder ... mavenTools: null [Was: Re: Programmatically get maven properties]

2014-01-07 Thread juliangeo
ctBuildingRequest request = new >>>>> DefaultProjectBuildingRequest(); >>>>> DefaultProjectBuilder builder = new DefaultProjectBuilder(); >>>>> >>>>> String mavenHome = System.getenv("M2_HOME"); >>>>> ArtifactReposit

Re: Programmatically get maven properties

2013-10-16 Thread sizu
40175.n5.nabble.com/Programmatically-get-maven-properties-tp4912280p5773156.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e

Re: DefaultProjectBuilder ... mavenTools: null [Was: Re: Programmatically get maven properties]

2012-02-13 Thread Max Spring
Yes, having a projectBuilder in the Mojo did the trick. Thank you! The complete working example is down below. -Max package org.example; import java.io.File; import org.apache.maven.model.Model; import org.apache.maven.model.building.ModelBuildingRequest; import org.apache.maven.plugin.Abstract

Re: DefaultProjectBuilder ... mavenTools: null [Was: Re: Programmatically get maven properties]

2012-02-10 Thread Olivier Lamy
Hello, You must probably use: /** * @component */ private ProjectBuilder projectBuilder; 2012/2/10 Max Spring : > I'm running into the same "mavenTools: null" problem, but my code sits in a > Maven 3.0.3 mojo: > >  public class MyMojo extends AbstractMojo{ > >    /** @parameter

DefaultProjectBuilder ... mavenTools: null [Was: Re: Programmatically get maven properties]

2012-02-10 Thread Max Spring
I'm running into the same "mavenTools: null" problem, but my code sits in a Maven 3.0.3 mojo: public class MyMojo extends AbstractMojo{ /** @parameter default-value="${repositorySystemSession}" */ private RepositorySystemSession repoSession; public void execute() throws MojoExecu

Re: Programmatically get maven properties

2011-10-18 Thread Jörg Schaible
t(); > Properties properties = project.getProperties(); > > Trouble is it's giving me errors with "mavenTools: null" > > -- > View this message in context: > http://maven.40175.n5.nabble.com/Programmatically-get-maven-properties- tp4912280p4913348.html > Se

Re: Programmatically get maven properties

2011-10-18 Thread Barrie Treloar
On Tue, Oct 18, 2011 at 10:02 PM, deusaquilus wrote: > Here's what I'm doing: > > File pom = new File("pom.xml"); > DefaultProjectBuildingRequest request = new DefaultProjectBuildingRequest(); > DefaultProjectBuilder builder = new DefaultProjectBuilder(); > > String mavenHome = System.getenv("M2_H

Re: Programmatically get maven properties

2011-10-18 Thread deusaquilus
lRepository); MavenProject project = builder.build(pom, request).getProject(); Properties properties = project.getProperties(); Trouble is it's giving me errors with "mavenTools: null" -- View this message in context: http://maven.40175.n5.nabble.com/Programmatically-get-maven-prop

Re: Programmatically get maven properties

2011-10-17 Thread Barrie Treloar
On Tue, Oct 18, 2011 at 2:22 PM, Brian Topping wrote: > The code you put in your original email didn't make it to the list, maybe it > was formatted somehow. > > What I think you are looking for is: > >> /** @parameter default-value="${project}" */ >> private org.apache.maven.project.MavenProject

Re: Programmatically get maven properties

2011-10-17 Thread Brian Topping
uot;mavenTools: null" exception to be thrown from the > MavenProject class. > How do I get this to work? > > -- > View this message in context: > http://maven.40175.n5.nabble.com/Programmatically-get-maven-properties-tp4912280p4912280.html > Sent from the Maven - Users mai

Programmatically get maven properties

2011-10-17 Thread deusaquilus
s to return null. The other way I tried was using the maven builder APIs like so: That causes a "mavenTools: null" exception to be thrown from the MavenProject class. How do I get this to work? -- View this message in context: http://maven.40175.n5.nabble.com/Programmatically-get-mav