You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Mark Russell <ma...@instantiations.com> on 2007/11/14 15:22:24 UTC

Getting access to the versions in a POM

I am writing an internal plugin for maven 2 for our company.  One of the things I need to do is to get access to the dependency 
information that is configured in the pom.  Is there a way to do that?  I have done several web searches but can not come up 
with the correct string to get me an answer.

Please point me to a web page that will help me.

Thanks in advance :->

-- 
Mark Russell
Instantiations, Inc.
724-368-3331 (land line)
http://www.instantiations.com

Re: Getting access to the versions in a POM

Posted by Tom Huybrechts <to...@gmail.com>.
The mojo developer cookbook has part of this info. Feel free to add more...

http://docs.codehaus.org/display/MAVENUSER/Mojo+Developer+Cookbook

Tom


On Nov 14, 2007 5:11 PM, Mark Russell <ma...@instantiations.com> wrote:
> Wayne:
> Thanks That should get me started.  I'll do some searching and then post back any resources I find.
>
>
> Wayne Fay wrote:
> > In your mojo, you'll need:
> >  * @requiresDependencyResolution
> >  * @requiresProject
> >
> > And then:
> >     /**
> >      * <i>Maven Internal</i>: Project to interact with.
> >      *
> >      * @parameter expression="${project}"
> >      * @required
> >      * @readonly
> >      */
> >     private MavenProject project;
> >
> > Then you can navigate around in the MavenProject object to find the
> > dependencies and their versions etc. I assume this is on the web
> > somewhere but I'm not sure where, perhaps Wiki? Or Plugin Dev Center?
> >
> > Wayne
> >
> > On 11/14/07, Mark Russell <ma...@instantiations.com> wrote:
> >> I am writing an internal plugin for maven 2 for our company.  One of the things I need to do is to get access to the dependency
> >> information that is configured in the pom.  Is there a way to do that?  I have done several web searches but can not come up
> >> with the correct string to get me an answer.
> >>
> >> Please point me to a web page that will help me.
> >>
> >> Thanks in advance :->
> >>
> >> --
> >> Mark Russell
> >> Instantiations, Inc.
> >> 724-368-3331 (land line)
> >> http://www.instantiations.com
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
>
> --
>
> Mark Russell
> Instantiations, Inc.
> 724-368-3331 (land line)
> http://www.instantiations.com
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Getting access to the versions in a POM

Posted by Mark Russell <ma...@instantiations.com>.
Wayne:
Thanks That should get me started.  I'll do some searching and then post back any resources I find.

Wayne Fay wrote:
> In your mojo, you'll need:
>  * @requiresDependencyResolution
>  * @requiresProject
> 
> And then:
>     /**
>      * <i>Maven Internal</i>: Project to interact with.
>      *
>      * @parameter expression="${project}"
>      * @required
>      * @readonly
>      */
>     private MavenProject project;
> 
> Then you can navigate around in the MavenProject object to find the
> dependencies and their versions etc. I assume this is on the web
> somewhere but I'm not sure where, perhaps Wiki? Or Plugin Dev Center?
> 
> Wayne
> 
> On 11/14/07, Mark Russell <ma...@instantiations.com> wrote:
>> I am writing an internal plugin for maven 2 for our company.  One of the things I need to do is to get access to the dependency
>> information that is configured in the pom.  Is there a way to do that?  I have done several web searches but can not come up
>> with the correct string to get me an answer.
>>
>> Please point me to a web page that will help me.
>>
>> Thanks in advance :->
>>
>> --
>> Mark Russell
>> Instantiations, Inc.
>> 724-368-3331 (land line)
>> http://www.instantiations.com
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 


-- 
Mark Russell
Instantiations, Inc.
724-368-3331 (land line)
http://www.instantiations.com

Re: Getting access to the versions in a POM

Posted by Wayne Fay <wa...@gmail.com>.
In your mojo, you'll need:
 * @requiresDependencyResolution
 * @requiresProject

And then:
    /**
     * <i>Maven Internal</i>: Project to interact with.
     *
     * @parameter expression="${project}"
     * @required
     * @readonly
     */
    private MavenProject project;

Then you can navigate around in the MavenProject object to find the
dependencies and their versions etc. I assume this is on the web
somewhere but I'm not sure where, perhaps Wiki? Or Plugin Dev Center?

Wayne

On 11/14/07, Mark Russell <ma...@instantiations.com> wrote:
> I am writing an internal plugin for maven 2 for our company.  One of the things I need to do is to get access to the dependency
> information that is configured in the pom.  Is there a way to do that?  I have done several web searches but can not come up
> with the correct string to get me an answer.
>
> Please point me to a web page that will help me.
>
> Thanks in advance :->
>
> --
> Mark Russell
> Instantiations, Inc.
> 724-368-3331 (land line)
> http://www.instantiations.com
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org