Hi Wendy, > For example, on jta artifact. > others POM declares jta-1.0.B.jar as dependency directly, > and spring-parent.pom(Spring artifacts' parent POM) declares jta as > optional. > Then jta-1.0.B.jar wasn't in WEB-INF/lib, too. I think I was wrong on optinal I removed all of optional on jta, then run "mvn package". The result was the same, jta-1.0.1B.jar still wasn't in WEB-INF/lib. And I search the repository, no dependency declares jta in excludes block. I'm very blocked by the matter?
Additionally, at the begging of the project, I set all dependencies in only one pom. At that time, all was OK. It sounds that the relation was very clean and simple. But now, why I have to encounter so ambiguous relationship?! The trouble is veryveryvery trouble :( a cup of Java, cheers! Sha Jiang Wendy Smoak-3 wrote: > > On 11/25/06, jiangshachina <[EMAIL PROTECTED]> wrote: > >> For example, on servlet-api artiface. >> I declare servlet-api-2.4.jar in others POM, but commons-loggin(in Apache >> POM) has transitive dependency servlet-api-2.3.jar. Both of them are >> compile >> scope. > > These poms are incorrect -- servlet-api shouldn't be in compile scope. > >> When I run "mvn package" for the Web project, I found that >> servlet-api-2.3.jar, but servlet-api-2.4.jar, in WEB-INF/lib. >> If I modified POM of commons-loggin, and declared servlet-api-2.3.jar as >> provided dependency, then none of them would be put into WEB-INF/lib! > > Modifying public poms is one way to do it, and can work if you have > complete control of an internal corporate repository. > > A better way to fix this is to add <exclusions> to the dependencies > that are causing the problem, then go back to the project in question > and ask them to fix it in the next release. Quite often the project > causing the problem is not using m2 to build, and the developers don't > understand what happens when they leave everything in compile scope. > > Another way that will work is to declare the servlet-api dependency in > your own project and properly mark it 'provided'. Since Maven uses > the "closest" definition for each artifact, that one will win. > > -- > Wendy > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Don%27t-add-dependency--tf2677027s177.html#a7545206 Sent from the Maven - Users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
