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, <[email protected]> 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:[email protected]]
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, <[email protected]> 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: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
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]