How to prevent duplicate servlet jar using eclipse+m2eclipse

前端 未结 5 565
说谎
说谎 2020-12-15 22:38

I\'m using Eclipse + Maven + m2eclipse to build and test a web application in Apache Tomcat.

I\'ve configured a Tomcat server inside Eclipse, and configured the depl

5条回答
  •  隐瞒了意图╮
    2020-12-15 23:12

    Normally there is a dependency in your project that is depending on servlet-apî.jar

    The default behaviour of Maven is that i wiill try to import your dependency + the dependencies of the imported dependency.

    If you want to exclude a specific "sub-dependency", you can give maven a configuration like this :

    
        com.hpsworldwide.mbtrs.switch
        YOUR_DEPENDENCY
        1.0
        
            
                javax.servlet
                servlet-api
            
        
    
    

    then maven will import YOUR_DEPENDENCY + all YOUR_DEPENDENCY dependencies, but will exclude servlet-api from the dependencies of YOUR_DEPENDENCY.

提交回复
热议问题