maven-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brett Porter <br...@apache.org>
Subject Re: MNG-4056, please comment
Date Mon, 02 Mar 2009 10:43:11 GMT
Yeah, it sounds right. The ids should definitely be normalized when  
reading them so that matching classifier/extension combos map back to  
the same types.

- Brett

On 02/03/2009, at 11:43 AM, Brian E. Fox wrote:

> Seems logical to me. I don't know why there are these special mappings
> in the first place. Sources is the other one that comes to mind... if
> true you should handle that the same.
>
> -----Original Message-----
> From: Benjamin Bentmann [mailto:benjamin.bentmann@udo.edu]
> Sent: Sunday, March 01, 2009 9:11 AM
> To: Maven Developers List
> Subject: MNG-4056, please comment
>
> Hi,
>
> I recently created a patch for MNG-4056 and would appreciate some
> comments whether that's the proper way to address the issue.
>
> In short, this issue is about the subtle difference between
>
>   <dependency>
>     <groupId>gid</groupId>
>     <artifactId>aid</artifactId>
>     <version>0.1</version>
>     <classifier>tests</classifier>
>   </dependency>
>
> and
>
>   <dependency>
>     <groupId>gid</groupId>
>     <artifactId>aid</artifactId>
>     <version>0.1</version>
>     <type>test-jar</type>
>   </dependency>
>
> i.e. <type>test-jar</type> vs. <classifier>tests</classifier>.
While
> both declarations work during builds of the consumer project that  
> run up
>
> to the "install" phase, only the latter declaration will allow proper
> dependency resolution from the reactor during an earlier lifecycle  
> phase
>
> like "package" (see also comments in MNG-2045 [0]).
>
> The cause for this difference is that resolution from the reactor
> matches artifacts by their dependency conflict id which has the form
> gid:aid:type:classifier. For the first dependency declaration above,  
> the
>
> type is "jar" which doesn't match the type "test-jar" as used for the
> attached test JAR.
>
> In case matching by dependency conflict id fails, the proposed patch
> falls back to another id I called repository conflict id (well, it
> needed to have a name...). The important difference is that the
> repository conflict id has the form gid:aid:extension:classifier, i.e.
> uses the file extension instead of the type.
>
> The rationale for this approach is the observation that the repository
> layout does not use the artifact type but the file extension to
> distinguish files. In other words, the ids
>   gid:aid:test-jar:tests:0.1
> and
>   gid:aid:jar:tests:0.1
> get mapped to the same physical file in the repository, namely
>   gid/aid/0.1/aid-0.1/aid-0.1-tests.jar
> i.e. there's an aliasing effect in the repository which the patch  
> mimics
>
> for dependency resolution from the reactor.
>
> It solves the problem from a user's perspective but I'm not sure  
> whether
>
> this kind of artifact identity is clean from a design perspective.  
> WDYT?
>
>
> Benjamin
>
>
> [0]
> http://jira.codehaus.org/browse/MNG-2045?focusedCommentId=152064&page=co
> m.atlassian.jira.plugin.system.issuetabpanels%3Acomment- 
> tabpanel#action_
> 152064
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>

--
Brett Porter
brett@apache.org
http://blogs.exist.com/bporter/


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


Mime
View raw message