Duplicating IRC response for the archives:
Not sure if this is exactly what you want, but here is some code I use to
retrieve a pom from an artifact:
Artifact pomArtifact = artifactFactory.createArtifact( artifact.getGroupId(),
artifact.getArtifactId(),
artifact.getVersion(), "", "pom" );
MavenProject pomProject = mavenProjectBuilder.buildFromRepository(
pomArtifact, remoteArtifactRepositories,
localRepository );
The mavenProjectBuilder can also build the pom from the local filesystem.
-----Original Message-----
From: Michael Böckling [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 18, 2006 8:14 AM
To: Maven Users List
Subject: Repository POMs: nobody knows?
Sorry if I'm being a nuisance, but doesn't anyone know how to read repository
".pom" files with variable interpolation enabled?
A little pointer into the right direction would already be sufficient...
Anyone?
> Hello,
>
> I have a question regarding the development of a Maven plugin.
> What I'm trying to do is this:
> - get the dependencies of the current project
> - locate their POMs
> - read those POMs, so I have a "Model" object
> - check if the "URL" element is set
>
> Now I've got that far by using the Maven embedder inside my Plugin.
> To parse the POM, I do this:
>
> Model aProjectModel = getEmbedder().readModel(aPomArtifact.getFile());
>
> This works ok, but there is a problem: no variable interpolation!
> E.g., for commons-lang, I get this value when calling
> "aProjectModel.getUrl()":
>
> http://jakarta.apache.org/commons/${pom.artifactId.substring(8)}/apidocs
>
> I can't use the "readProject()" method of the embedder, because it
> complains that the POMs format is not right ("bla element only allowed
> in deployed artifact POM").
> Now is there a way to get variable interpolation?
> I hope I'm not too complicated...
>
> Thanks to anyone who can help me,
> Michael Böckling
>
>
> P.S.: In case you wonder: I'm trying to assemble a list of
> Javadoc-Links of the dependent projects, so the generated Javadoc of
> the current project is fully inter-linked with its dependencies.
--
Giniality AG - Michael Böckling; Steinenberg 21, CH-4051 Basel
P: +41 61 226 99 63 - F: +41 61 226 99 69
[EMAIL PROTECTED]; http://www.giniality.com/
---------------------------------------------------------------------
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]