Hello,
I'm trying to create a plugin and the first thing I need to do is copy
something from the repository to a folder so I can manipulate it. I'm
trying to define my plugin configuration like this:
<configuration>

<groupId>junit</groupId>

<artifactId>junit</artifactId>

<version>3.8.1</version>

</configuration>

 

Now what I'd like to do is get an Artifact instance that represents this
object so I can call getFile(). I've tried many different ways of
calling artifactFactory.createArtifact with out luck. Can someone show
me or point me to how to figure this out? 

Here is what I have currently:

 
System.out.println("group:"+groupId+"Art:"+artifactId+"version:"+version
);
        this.artifactFactory = new DefaultArtifactFactory();
        
      
      
        Artifact artifact = artifactFactory.createArtifact
(groupId,artifactId,version,"jar",Artifact.SCOPE_COMPILE);
           
 
System.out.println("Path:"+artifact.getFile().getAbsolutePath());

 

I'm not sure if directly using the DefaultArtifactFactory is the right
way, but I'm not sure how to get an instance from anywhere else.

Is there an api reference for all the maven components somewhere? I
think thats the most complicated part...trying to figure out what to use
and then how to use it.

 

Thanks,

Brian

Reply via email to