You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Paul Benedict <pb...@apache.org> on 2016/07/28 20:52:39 UTC

Why MavenProject is not an Artifact?

It seems that the Artifact interface could be mostly applied to
MavenProject. I eyeball about 70% of the methods could apply. If this seems
unreasonable, I think an interface could be refactored out from both of
them supporting just these:

    String getGroupId();

    String getArtifactId();

    String getVersion();

    String getId();

BTW, unless I have missed it, I was surprised to see no "GAV" interface.
Thus, I propose this as the GAV interface. :-) That will certainly help
many mojo developers who want to collect such coordinates from their
<configuration> element.

Cheers,
Paul

Re: Why MavenProject is not an Artifact?

Posted by Robert Scholte <rf...@apache.org>.
Hi Paul,

i think you will like this link[1] where I tried to compare elements which  
have a GAV.
I had to write this down when working on the maven-artifact-transfer  
component.
I know how the Model is generated, so I kind of understand why the  
interface is missing.
As you can see, all these classes have a different meaning/goal and most  
of the time you know on which kind of instance you are working on.
Yes, this component introduces specific Coordinate interfaces, which  
probably matches your requirements.

Robert

[1]  
http://maven.apache.org/shared-archives/maven-artifact-transfer-LATEST/comparison.html


On Thu, 28 Jul 2016 22:52:39 +0200, Paul Benedict <pb...@apache.org>  
wrote:

> It seems that the Artifact interface could be mostly applied to
> MavenProject. I eyeball about 70% of the methods could apply. If this  
> seems
> unreasonable, I think an interface could be refactored out from both of
> them supporting just these:
>
>     String getGroupId();
>
>     String getArtifactId();
>
>     String getVersion();
>
>     String getId();
>
> BTW, unless I have missed it, I was surprised to see no "GAV" interface.
> Thus, I propose this as the GAV interface. :-) That will certainly help
> many mojo developers who want to collect such coordinates from their
> <configuration> element.
>
> Cheers,
> Paul

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org