2010/6/30 Nathan Bubna <[email protected]>: > So, if i wanted to use the servlet log, i would have to download and > use both a velocity-engine jar and a velocity-engine-servlet jar?
Yes. Or declare a dependency to velocity-log-servlet (I would like to name it this way) and velocity-engine will come as a transitive dependency. Otherwise, if you want a single package, we can prepare an uberjar using the Shade plugin, for Ant fanatics :-D To see the power of transitive dependencies, I suggest to download m2eclipse (the plugin inside Eclipse for Maven support) that has a pom editor, containing a graph of dependencies. It's nice to see how your project is built on various other frameworks. > is it worth that complexity just to have a "clear" > dependency hierarchy? Absolutely yes, optional dependencies are far more confusing than small modules. Take a look at how Tiles 2.2.2 is now, little modules with few classes, like tiles-servlet-wildcard, just to be sure to include Spring only when needed. > optional packages? so *can* Maven acknowledge that a dependency is > required for compilation but optional at runtime? i've been operating > under the (mis)conception that it could not. Yes it can, by adding <optional>true</optional>. It must not confused with <scope>provided</scope> that means that a package is needed when compiling, but it is "provided" by an external source, e.g. servlet.jar in a servlet container, so it must be present, but outside of the package itself. The "provided" scope is clearer with WARs: if the scope is "compile" or "runtime", the package is included in WEB-INF/lib, if it is provided, it is not (not sure about optional packages though). > what sort of transitive dependency troubles does it cause? If your project has optional packages, they must be included explicitly in projects that depend on it if you want to use them. The same for "provided" packages. If you have a module with no optional packages you are declaring that your module can work *if and only if* all those packages are present; Maven recognizes this situations and uses all transitive dependencies for compiling and the rest (depending on the scope). Antonio --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
