Thanks for that first answer. It allowed me to pushed a bit further following 
the code in remote-resources plugin.  It appears I have to write an 
implementation of Downloader.class (in maven-downloader).  The concrete impl is 
DefaultDownloader, which only gets the jar, has two members:

/**
     * @plexus.requirement
     */
    private ArtifactResolver artifactResolver;

    /**
     * @plexus.requirement
     */
    private ArtifactFactory artifactFactory;

That get injected via plexus.  When I run in the debugger these two members do 
get injected with valid instances.  I used the plexus configuration 
"components.xml" to define:

<component-set>
  <components>
    <component>
      <role>org.apache.maven.shared.downloader.Downloader</role>
      
<implementation>com.qualcomm.qis.osdiagram.mojo.PomDownloader</implementation>
    </component>
  </components>
</component-set>

Which likewise has the same two members.  However, although I do see my 
subclass of Downloader get registered, the two member variables are null.  Can 
anybody point me to some code fragments that show me how this gets wired 
together so that not only does my derived class gets registered, but also its 
two members?

Thanks,
Adam

-----Original Message-----
From: Brett Porter [mailto:[email protected]] 
Sent: Tuesday, June 09, 2009 10:35 PM
To: Maven Developers List
Subject: Re: Looking up the license of dependencies in a pom.xml

It doesn't need to do that much.

Take a look at the remote-resources plugin and the apache-jar-resource- 
bundle (particularly DEPENDENCIES.vm) - they do exactly what you want  
and should show you where to direct your efforts.

- Brett

On 10/06/2009, at 2:11 PM, Perry-Pelletier, Adam wrote:

> I'm taking my first crack at developing a plugin.  I'm trying to  
> read/resolve the license for a particular dependency.  I've read  
> tons of code but can't seem to pull it all together.  I've read  
> dependency plugin resolve code, I've see the the MavenProject does  
> have license information, but the basic Dependency object does not  
> have this information.  I presume I need to:
>
>
> 1)      Grab hold of the Dependency object.
>
> 2)      Reach back out and retrieve the pom.xml for that file.
>
> 3)      Convert that pom.xml to a MavenProject object
>
> 4)      Get the license for the MavenProject.
>
> Alternatively, I was going to just do an HTTP GET on the pom.xml for  
> a given dependency, parse it and find the license.  But surely there  
> is a clean way to do this.  Can anyone shoot me a code fragment that  
> does this.
>
> Thank in advance for any help.
>
> Adam


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to