You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Tristan JC Rouse <tr...@tristanjcrouse.com> on 2009/09/18 22:30:00 UTC

Resolving artifacts in Maven API

Hi,

I'm trying to figure out how to work the DefaultArtifactResolver class. I
just need to get Maven to resolve an artifact from the remote repository and
download it to the local repository and give me the path. I'm assuming that
after you pass an Artifact to the DefaultArtifactResolver's
resolve(Artifact, List, ArtifactRepostiory) method, this method will update
the value returned by the Artifact parameter's Artifact.getFile() method to
return it's location in the local repository, but please correct me if this
is wrong.

I'm having a few problems. In order to invoke the
DefaultArtifactResolver.resolve(Artifact, List, ArtifactRepository) method I
need an ArtifactRepository which specifies the local repository. The
MavenProject class does not seem to provide this and while I may be able to
construct one from scratch if I can figure out the ArtifactRepositoryLayout
class (a parameter to its simplest constructor) the other information (id,
URL) should really come from the "conf/settings.xml" file and I can't figure
out where to access these values.

Any input on: how to access the local repository id, URL values in order to
construct a DefaultArtifactRepository *or better yet*, get maven to
instantiate an ArtifactRepository for me configured to represent the local
repository, etc would be greatly appreciated.

Thanks!

PS

Is there really that little human written information in the javadocs?

-- 
Tristan JC Rouse

Re: Resolving artifacts in Maven API

Posted by Tristan JC Rouse <tr...@tristanjcrouse.com>.
I apologize for rewriting this without seeing Benjamin Bentmann's response
to my earlier letter. I fail at using mailing lists. Thanks very much for
the response.

On Fri, Sep 18, 2009 at 3:30 PM, Tristan JC Rouse <
tristan@tristanjcrouse.com> wrote:

> Hi,
>
> I'm trying to figure out how to work the DefaultArtifactResolver class. I
> just need to get Maven to resolve an artifact from the remote repository and
> download it to the local repository and give me the path. I'm assuming that
> after you pass an Artifact to the DefaultArtifactResolver's
> resolve(Artifact, List, ArtifactRepostiory) method, this method will update
> the value returned by the Artifact parameter's Artifact.getFile() method to
> return it's location in the local repository, but please correct me if this
> is wrong.
>
> I'm having a few problems. In order to invoke the
> DefaultArtifactResolver.resolve(Artifact, List, ArtifactRepository) method I
> need an ArtifactRepository which specifies the local repository. The
> MavenProject class does not seem to provide this and while I may be able to
> construct one from scratch if I can figure out the ArtifactRepositoryLayout
> class (a parameter to its simplest constructor) the other information (id,
> URL) should really come from the "conf/settings.xml" file and I can't figure
> out where to access these values.
>
> Any input on: how to access the local repository id, URL values in order to
> construct a DefaultArtifactRepository *or better yet*, get maven to
> instantiate an ArtifactRepository for me configured to represent the local
> repository, etc would be greatly appreciated.
>
> Thanks!
>
> PS
>
> Is there really that little human written information in the javadocs?
>
> --
> Tristan JC Rouse
>



-- 
Tristan JC Rouse