intelij keeps inserting jars even after i deleted them

hi..

i've just upgraded our pom.xml to use tomcat 6.0.37, which means we also upgraded servlet jars (2.5), however, we also have another servlet jar 2.3, which causes classpath conflicts (noSuchMethodfound), we don't use directly servlet 2.3, but active mq has very distint dependcy on it, so i thought i would be able to just remove it from the lbiraries node in the projects window if intelij but it keeps coming back.

1 comment
Comment actions Permalink

For maven based projects, IntelliJ IDEA will pull in all library JARs as defined in the POM. If you remove it from the library list, IDEA just pulls it back in if it is in POM dependency tree. It sounds like the Servlet 2.3 dependency is still declared in a POM. Either directly in one of your POMs, or as a transitive dependency. Run mvn dependency:tree in the terminal tool window [Tools > Open Terminal...]. You can output it to a file via mvn dependency:tree > tree.txt and then open it in IDEA if that makes it easier. Search the dependency tree output for the Servlet 2.3 dependency. If it is in your POM, remove it. If it is a transitive to a dependency, you will need to add an <exclude> element to the declaration of that dependency. If it is a transitive of a transitive, you need to exclude the parent transitive, and then add as dependencies all the other dependencies of the parent transitive. See the dependency:tree documentation and Optional Dependencies and Dependency Exclusions for more information.

0

Please sign in to leave a comment.