本文介绍了为什么不在pom.xml中注释一个依赖关系(使用m2eclipse)删除tomcat服务器deploy目录下的jar?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始使用Maven 2.2.1并下载了最新的m2eclipse插件版本0.12.0。我使用的是Eclipse 3.5.1和Tomcat 6.0.26。

我签出了项目(在eclipse中:文件>新建>项目> SVN>项目从SVN),当我运行服务器时,我遇到以下异常:

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

其中需要删除jsp-api2.1.jar(从我从其他帖子中发现)。

which required deleting the jsp-api2.1.jar (as I found out from other posts).

现在我想简单地在pom.xml中评论jsp-api2.1.jar的依赖关系,我做到了,而jsp-api2 .1.jar从Maven依赖关系消失了。但是一旦我再次启动服务器,我看到了同样的例外。我检查了tomcat服务器部署目录,我可以再次看到相同的jsp-api2.1.jar!我创建了一个新的服务器,但我看到那里的jar。

这是m2eclipse的问题吗? eclipse maven和m2eclipse的版本之间是否有冲突?还是应该设置一些东西?

从服务器部署目录中删除jsp-api2.1.jar做了这​​个工作,但是我需要做这个手动总是吗?

Deleting the jsp-api2.1.jar from the server deployment directory did the job, but do I need to do this manually always?

Kind Regards,

Despot

Kind Regards,
Despot

推荐答案

I've had this happen to me a ton of times. Typically it is because the JAR in question is a transitive dependency of something else (or of multiple items).

使用Eclipse M2Eclipse POM编辑器中的依赖层次视图,然后在右侧找到您的JAR,然后单击它。在左侧,您将看到导致该JAR存在的所有依赖路径。您必须将其全部剪辑,方法是将其注释或添加排除节。

Use the "Dependency Hierachy" view in the Eclipse M2Eclipse POM editor and find your JAR on the right hand side...then click on it. On the left hand side you will see all of the dependency paths that led to that JAR being there. You'll have to clip them all off by either commenting them out or adding an "exclude" stanza.

一旦这样做,您将需要重新启动Eclipse 。对不起,但我从来没有看到Eclipse动态地删除了一个JAR而不重新启动它。 Bozho关于清洁的提示可能会起作用,但是我会重新启动。

Once this is done, you will HAVE to restart Eclipse. Sorry, but I have never yet seen Eclipse dynamically delete a JAR without restarting it. Perhaps Bozho's tip about cleaning could work, but I'd restart anyway.

重新启动后,进入项目浏览器并打开Maven依赖关系库并查找JAR 。如果它在那里,回去继续尝试和消除JAR,如上所述。如果从Maven依赖图库中消失,那么你应该很好去。

Once restarted go into the project explorer and open the "Maven Dependencies" library and look for the JAR. If it is there, go back and continue to try and eliminate the JAR as I mentioned above. If it is gone from the Maven Dependencies library, then you should be good to go.

如果从项目特定的Maven Dependencies库中消失,但仍然在部署目录中,那么您有幸提供M2Eclipse的错误!

If it is gone from the project specific Maven Dependencies library, and yet still within the deploy directory then you have the honor of filing a bug with M2Eclipse!

这篇关于为什么不在pom.xml中注释一个依赖关系(使用m2eclipse)删除tomcat服务器deploy目录下的jar?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-22 07:21
查看更多