Why doesn't comment on the dependency in pom.xml (with m2eclipse) remove the jar in the tomcat server deployment directory?

I started using Maven 2.2.1 and downloaded the latest version of m2eclipse plugin version 0.12.0. I am using Eclipse 3.5.1 and Tomcat 6.0.26.
I checked the mvc-ajax project (in eclipse: File> New> Project> SVN> Project from SVN), and when I started the server, I came up with the following exception:

org.apache.jasper.JasperException: Failed to read TLD "META-INF / c.tld" from the JAR file. File: /tomcatDeployDirectory/mvc-ajax/WEB-INF/lib/jstl-1.2.jar "

which requires the removal of jsp-api2.1.jar (as I found out from other posts).

Now I just wanted to comment on the dependency for jsp-api2.1.jar in pom.xml, and I did it and jsp-api2.1.jar disappeared due to Maven dependencies. But as soon as I started the server again, I saw the same exception. I checked the tomcat server deployment directory and again I see the same jsp-api2.1.jar! I created a new server, but I see a jar there.
Is this a problem with m2eclipse? Is there any contradiction between the eclipse maven and m2eclipse versions? Or should I install something extra?

Removing jsp-api2.1.jar from the server deployment directory completed the task, but do I need to do this manually always?

Yours faithfully,
Despot

+1
eclipse svn maven-2 tomcat6 m2eclipse
source share
2 answers

This has happened to me many times. This is usually due to the fact that the JAR in question is a transitive dependency of something else (or several elements).

Use the Dependency Hierarchy view in the Eclipse M2Eclipse POM editor and find your JAR on the right side ... then click on it. On the left you will see all the dependency paths that led to the JAR being there. You will have to fix them by commenting on them or adding the exclude stanza.

Once this is done , you need to restart Eclipse . Sorry, but I have not yet seen Eclipse dynamically delete the JAR without restarting it. Perhaps Bozo's advice on cleaning might work, but I still restarted.

After restarting, go into the project explorer and open the "Maven Dependencies" library and find the JAR. If there is one, go back and keep trying to eliminate the JAR, as I mentioned above. If he left the Maven Dependencies library, you should be good to go.

If he left the Maven project specific dependency library and is still in the deployment directory, then you have the honor to register an error with M2Eclipse!

+1
source share

You must call mvn clean so that your target dir file is cleared.

With m2eclipse, you do this from a dialog. Right click the pom file > Run As > Maven Clean

Btw, for jsp-api dependency you can set s <provided>

+2
source share

All Articles