Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aether-users] Determining the GAV of poms in remote repository

Benjamin,

Thanks for the response and sorry about being in the wrong place.  I will look at all what you suggest.  The reason I thought Aether might be involved is because the pom's parent (and all that that brings) needs to be resolved from remote repositories (so I was thinking pom = aether artifact and remote repository = aether repository).  However, I can see that understanding poms would tie you heavily to Maven.  I suppose I thought it would be something like:


On Sat, Feb 16, 2013 at 8:16 AM, Benjamin Bentmann <bentmann@xxxxxxxxxxxx> wrote:
Samuel Cox wrote:

I posted the following to the Maven mailing list, but I'm guessing this
list is more appropriate.  Essentially, what I need is the following
function:

gav(File settingsXml, File pom) => GAV coordinates

Aether is about artifacts and repositories, not pom.xml or settings.xml reading. So this mailing list is not the appropriate place to ask about Maven-specific functionality.


I'm writing a standalone program that needs to find the GAV coordinates for
a Maven pom file, which is retrieved from Subversion.  In the simple case,
this is easy.  I just parse the pom.  However, things get much more
complicated when only the artifactId is present.

Is this possible?  It seems like it should be since Maven can build the
project if I check it out (presumably by resolving all the parent stuff).

For any well-maintained POM file, its GAV can be determined from just that file, either from project.groupId|artifactId|version or from project.parent.groupId|artifactId|version if former values are omitted.

Maven itself uses DefaultProjectBuilder, DefaultSettingsBuilder and a couple other components to build the full MavenProject instance. Details about said components can be asked on the Maven mailing lists or just gleaned from Maven's source code.


Benjamin
_______________________________________________
aether-users mailing list
aether-users@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/aether-users


Back to the top