You are previewing Maven: The Definitive Guide.

Maven: The Definitive Guide

Cover of Maven: The Definitive Guide by Sonatype Company Published by O'Reilly Media, Inc.

Project Dependencies

Maven can manage both internal and external dependencies. An external dependency for a Java project might be a library such as Plexus, the Spring Framework, or Log4J. An internal dependency is illustrated by a web application project depending on another project that contains service classes, model objects, or persistence logic. Example 9-3 shows some examples of project dependencies.

Example 9-3. Project dependencies


The first dependency is a compile dependency on the XFire SOAP library from Codehaus. You would use this type of dependency if your project depended on this library for compilation, testing, and during execution. The second dependency is a test-scoped dependency on JUnit. You would use a test-scoped dependency when you need to reference this library only during testing. The last dependency in Example 9-3 is a dependency on the Servlet 2.4 API as implemented by the Apache Geronimo project. The last dependency is scoped as a provided dependency. You would use a provided scope ...

The best content for your career. Discover unlimited learning on demand for around $1/day.