I wouldn't recommended using provided scope as you or your fellow developers may unintentionally in development/compile time make use of some resource or type from dependency in provided scope, but then get a nasty surprise at runtime.
Typically I'd use dependencyManagement at parent level, and exclude unwanted dependency as many times as needed. If that dependency set with exclusions repeats across several different projects, then define it once in a module with pom packaging, which gets imported (import scope) in different projects. Regards, Stevo. On Mon, Jan 17, 2011 at 1:59 PM, Jesse Farinacci <[email protected]> wrote: > Hi, > > On Mon, Jan 17, 2011 at 4:49 AM, <[email protected]> wrote: >> is it possible to exclude a dependency without specifying from which other >> dependency it might come from ? >> Like "wherever depA is coming from, exclude it" ? > > Until MNG-1977 is resolved, you can perform a simple work around. E.g. > > <project> > <build> > <dependencies> > <groupId>commons-logging</<groupId> > <artifactId>commons-logging</<artifactId> > <scope>provided</scope> > </dependencies> > </build> > </project> > > The scope=provided instructs Maven to not actually bring that > dependency into the classpath, thus, it behaves as a global exclude. > > -Jesse > > -- > There are 10 types of people in this world, those > that can read binary and those that can not. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
