That is the point.

A sample :
my.project:test:1.0-SNAPSHOT (a Project)
my.utility:xml:1.0 (an utils librarie)
dom4j:dom4j:1.6 (the well known XML library)

I added to my.project:test the my.utility:xml which talk about XML which use (and include in it's pom.xml) the dom4j:dom4j:1.6 artifact.

my.project:test
|----> my.utility:xml
                |----> dom4j:dom4j


I can now work with classes from my.utility:xml. Everything OK, compiles, packages, as expected.

But now, nothing prevents me to use directly classes from dom4j in my own code. The compiler will not complains, but it should because the dom4j is only a transitive dependency. I must add dom4j to my.project:test pom.xml before using it, mustn't I ?.
This sample is light enough to take care of, but what if I play with a lot more librairies.

The point is why not treat dom4j:dom4j as a 'RUNTIME' library from the my.project:test point of view ? The compiler will explicitly tell me that dom4j classes are not part of my compilation classpath and that I have to add it in my pom

my.project:test
|----> my.utility:xml
|                |----> dom4j:dom4j
|----> dom4j:dom4j

Hoping I make things more clear.

Stéphane


Wayne Fay a écrit :
The fact is that some dependencies that I use, handles other dependencies
that I use too. My IDE is therefore unable to tell me that I forget to add a
dependency because of the transitivity.
    

If a given module uses an artifact directly, it must be included as a
dependency in its pom file, not as a transitive dep.

If that doesn't answer your question, perhaps a concrete explanation
of what you're describing would make things more clear.

Wayne

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

  

--
4Dconcept
Stéphane TOUSSAINT
Tel : 01.61.08.50.27
Std : 01.61.08.50.20
Fax : 01.61.38.24.41

Reply via email to