In a Mojo developer cookbook [1] I found the snippet of code that
shows how to get the path of an artifact in the local repository.
Namely,

<snippet>
Set artifacts = project.getDependencyArtifacts();
for (Iterator artifactIterator = artifacts.iterator();
artifactIterator.hasNext();) {
 Artifact artifact = (Artifact) artifactIterator.next();
 if (artifact.getGroupId().equals(dependency.getGroupId()) &&
artifact.getArtifactId().equals(dependency.getArtifactId())) {
   return artifact.getFile().getPath();
 }
}
</snippet>

Of course, "project" is injected into the Mojo with the @parameter
expression="${project}".

That probably works fine from inside a Mojo.

However, what do I need to do to determine the local file system
location of an artifact from outside a Mojo (i.e. a junit test).
Thank you very much for your time and help.

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

--
Alex
http://www2.truman.edu/~ah428

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to