Hi Robert, Thank you for your reply.
I need the name just for documentation purposes and not for any build related things, so it's no problem at all. Okay, I'll have a look at the ModelBuilder. That's add because I had a look at the Nexus and that artifact is not in one of the "hosted" repositories, but in a "proxy" repository. So it wasn't manually uploaded to the Nexus server. But I'll deleting it in my local repository and let Maven download it again from the Nexus server. Let's see if that solves the problem... Regards, Gerrit -----Ursprüngliche Nachricht----- Von: Robert Scholte [mailto:rfscho...@apache.org] Gesendet: Freitag, 8. Juni 2018 10:30 An: users@maven.apache.org; Hohl, Gerrit Betreff: Re: AW: Maven plug-in development: Obtaining name of artifact Hi Gerrit, so you have 2 different questions: How to get the project name out of the pom for a specific artifact? Not sure if you have chosen the right approach, because the name is buildtime information. Once the jar is on the classpath/modulepath there should be no reason to know the name. If you still think you need it, have a look at org.apache.maven.model.building.ModelBuilder, that should be your entrypoint to the information in the pom. (still, think twice...) How can a pom be different for the same non-snapshot artifact? This line says it all: <description>POM was created by Sonatype Nexus</description> So it seems that this jar was uploaded by hand into Nexus, instead of letting it download directly from central. With manual uploads you can only know the groupId, artifactId and version. thanks, Robert On Fri, 08 Jun 2018 09:12:05 +0200, <g.h...@aurenz.de> wrote: > Hello Robert, > > sorry for being not very specific in my previous mail. > I'm talking about the <name> element in the POM. > > This is some kind of problem as I don't have the POM file of the > artifact. > I'm using a Nexus repository server. > And the POM file downloaded to my local repository is not the original > one, but one created by Nexus. > Beat me why it is this way. > > I also mentioned that in my last mail from yesterday. Did you get that > mail also? > > Regards, > Gerrit > -----Ursprüngliche Nachricht----- > Von: Robert Scholte [mailto:rfscho...@apache.org] > Gesendet: Donnerstag, 7. Juni 2018 23:03 > An: Maven Users List > Betreff: Re: Maven plug-in development: Obtaining name of artifact > > What do you mean with "name of the artifact": the value of the > name-element in the pom? The name of the file? > > Robert > > On Thu, 07 Jun 2018 09:46:25 +0200, <g.h...@aurenz.de> wrote: > >> Hello everyone, :-) >> >> >> I'm currently writing a Maven plug-in and I have the coordinates of >> artifacts (groupId, artifactId, version), but I need the names of the >> artifacts. >> >> Is there an easy way to get them (within my plug-in without relying on >> other plug-ins)? >> >> >> Regards, >> >> Gerrit >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org