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
ctBuildingRequest request = new
>>>>> DefaultProjectBuildingRequest();
>>>>> DefaultProjectBuilder builder = new DefaultProjectBuilder();
>>>>>
>>>>> String mavenHome = System.getenv("M2_HOME");
>>>>> ArtifactReposit
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
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
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
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
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
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
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
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
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
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
12 matches
Mail list logo