You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Jesper Linvald <je...@kabelnettet.dk> on 2004/11/29 20:32:59 UTC

Inexpedient dependency resolvment

Hi all,
 
I think there might be a small bug in the way dependencies are currently
being resolved?
 
SCENARIO:
 
Two (or more) dependencies with same name but different extensions and types
are specified in the POM:
 
    <dependency>
      <groupId>mydep</groupId>
      <artifactId>mydep</artifactId>
      <version>1.0</version>
      <type>tld</type>
    </dependency>
    <dependency>
      <groupId>mydep</groupId>
      <artifactId>mydep</artifactId>
      <version>1.0</version>
      <type>jar</type>
    </dependency>
 
 
In the end only one of them (the tld dependency) gets properly resolved,
loaded and downloaded – no error message is conveyed in respect to failed or
erroneous dependencies!
The mydep-1.0.jar is not added as a dependency at all – to my best knowledge
it is completely ignored (maybe because there is a map impl. behind the
scenes?)
If the order of dependencies are reversed then the jar file is loaded and
copied!
 
The documentation specifies that only jar, ejb and plugin are “known and
recognized” types. I have however seen extensive usage of other types such
as ears, wars etc.
 
In my project we have further overloaded the type definitions to include
xmls and tlds because it is extremely useful – maybe the type of dependency
is not supposed to be arbitrary? I think it should! First class dependencies
should not be limited to only a specific set of types I think! The
repository is where I like to keep ALL dependencies and artefacts and a
dependency is a good and general way to specify a global path to get to it! 
 
In my way of Maven thinking these filetypes (tlds and xmls) are not simply
resources (for test or jar files as the documentation states) but full blown
dependencies without which I like my build to fail!
The issue might be more relevant in connection with deployment (where I
might like tlds to be deployed with the deploy:copy-deps goal) but I think
it is a general mistake if duplicates of artefact simple names are not
allowed if they otherwise differ on other parameters such as type/extension
or the like….
 
Does it make sense?
 
______________________________________________________________
:)esper Linvald
 
 

-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.289 / Virus Database: 265.4.3 - Release Date: 26-11-2004
 

Re: Inexpedient dependency resolvment

Posted by Brett Porter <br...@gmail.com>.
Searching the archives is faster than typing such a long email :)

Already fixed in CVS HEAD for Maven 1.1.

- Brett


On Mon, 29 Nov 2004 20:32:59 +0100, Jesper Linvald
<je...@kabelnettet.dk> wrote:
> Hi all,
> 
> I think there might be a small bug in the way dependencies are currently
> being resolved?
> 
> SCENARIO:
> 
> Two (or more) dependencies with same name but different extensions and types
> are specified in the POM:
> 
>     <dependency>
>       <groupId>mydep</groupId>
>       <artifactId>mydep</artifactId>
>       <version>1.0</version>
>       <type>tld</type>
>     </dependency>
>     <dependency>
>       <groupId>mydep</groupId>
>       <artifactId>mydep</artifactId>
>       <version>1.0</version>
>       <type>jar</type>
>     </dependency>
> 
> In the end only one of them (the tld dependency) gets properly resolved,
> loaded and downloaded – no error message is conveyed in respect to failed or
> erroneous dependencies!
> The mydep-1.0.jar is not added as a dependency at all – to my best knowledge
> it is completely ignored (maybe because there is a map impl. behind the
> scenes?)
> If the order of dependencies are reversed then the jar file is loaded and
> copied!
> 
> The documentation specifies that only jar, ejb and plugin are "known and
> recognized" types. I have however seen extensive usage of other types such
> as ears, wars etc.
> 
> In my project we have further overloaded the type definitions to include
> xmls and tlds because it is extremely useful – maybe the type of dependency
> is not supposed to be arbitrary? I think it should! First class dependencies
> should not be limited to only a specific set of types I think! The
> repository is where I like to keep ALL dependencies and artefacts and a
> dependency is a good and general way to specify a global path to get to it!
> 
> In my way of Maven thinking these filetypes (tlds and xmls) are not simply
> resources (for test or jar files as the documentation states) but full blown
> dependencies without which I like my build to fail!
> The issue might be more relevant in connection with deployment (where I
> might like tlds to be deployed with the deploy:copy-deps goal) but I think
> it is a general mistake if duplicates of artefact simple names are not
> allowed if they otherwise differ on other parameters such as type/extension
> or the like….
> 
> Does it make sense?
> 
> ______________________________________________________________
> :)esper Linvald
> 
> --
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.289 / Virus Database: 265.4.3 - Release Date: 26-11-2004
> 
>

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