If I understand the situation
A depends on B with a provided scope
B depends on C with a provided scope.

B should clearly indicate this on the outside of the box right under the "Consuming this over a long period will cause cancer or at least confusion" in big red letters: "You need to provide a compatible C in order to get the desired effect from B." It should also tell you what sort of C you need to provide for each sort of B you need to consume.

If B is not, or can not be, delivered as a fully functional unit (black box) it has to tell the user.

I would make a maven artifact BC out of a working combination of B and C and store that in my repo as "BC" and make my A's depend on BC rather than including both B and C as provided in A. I would then provide BC rather than B and C or I would make it compile scope and get Maven to include BC in my build.


Ron


On 15/03/2013 6:14 AM, Patrick Schlebusch wrote:
Thomas Broyer wrote at some time:
Because a class in A transitively depends on a class provided by C then
it
*has* to know about C. Class hierarchy is part of the API (which is one
reason you should generally prefer composition over inheritance).
The compiler needs to know about artifact C of course. But I as the
consumer of artifact B should not need to know B's dependencies. Actually
I thought this was the reason for the whole automatic resolution of
transitive dependencies. This is not for convenience, it hides internal
details of B from A.

Otherwise that would mean I would need to first look at the POMs of all my
dependencies and basically copy all provided scope dependencies to my
project. Which kind of reminds me of software development without Maven.

Best regards,
Patrick

--------------------------------------------------------------------------------------------------------------------------------------------
Patrick Schlebusch - KISTERS AG - Charlottenburger Allee 5 - 52068 Aachen - 
Germany
Handelsregister Aachen, HRB-Nr. 7838 | Vorstand: Klaus Kisters, Hanns Kisters | 
Aufsichtsratsvorsitzender: Dr. Thomas Klevers
Tel.: +49 241 9671 -466 | Fax: +49 241 9671 -555 | E-Mail: 
[email protected] | WWW: http://www.kisters.de
--------------------------------------------------------------------------------------------------------------------------------------------
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. 
Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten 
haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. 
Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht 
gestattet.
This e-mail may contain confidential and/or privileged information. If you are 
not the intended recipient (or have received this e-mail in error) please 
notify the sender immediately and destroy this e-mail. Any unauthorised 
copying, disclosure or distribution of the material in this e-mail is strictly 
forbidden.


--
Ron Wheeler
President
Artifact Software Inc
email: [email protected]
skype: ronaldmwheeler
phone: 866-970-2435, ext 102


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to