[英]How do I make Eclipse automatically include jars I place in my WEB-INF/lib folder into my project?
When I was doing JSP/Servlet programming, whenever I dropped 3rd party libraries into the WEB-INF/lib folder, they were automatically included in the project classpath. 当我进行JSP / Servlet编程时,每当我将第三方库放入WEB-INF / lib文件夹时,它们都会自动包含在项目类路径中。 In GWT, this is not the case.
在GWT中,情况并非如此。 Anyone know why?
谁知道为什么? I loved how easy this was in JSP and I'd like these jars to be included automatically the same way.
我喜欢这在JSP中的容易程度,我希望这些罐子能够以相同的方式自动包含在内。
If you are using the Google Plugin for Eclipse then my understanding is that a Google Web Application Project is just not the same animal than a Dynamic Web Project and thus behave differently. 如果您使用的是Google Plugin for Eclipse,那么我的理解是Google Web应用程序项目与动态Web项目不同,因此表现不同。 So if your project depends on libraries not provided by the GWT and App Engine SDKs, you'll need to put them in
war/WEB-INF/lib
and to add them explicitly to your Java build path. 因此,如果您的项目依赖于GWT和App Engine SDK未提供的库,则需要将它们放在
war/WEB-INF/lib
,并将它们显式添加到Java构建路径中。
在Eclipse Galileo中,右键单击Web项目并选择构建路径,然后选择Java EE Module Dependencies并添加jar。
There is a plug-in technique that may help you if you want a directory where new jars are automatically updated in your build path, see this other post: 如果你想要一个在你的构建路径中自动更新新jar的目录,有一种插件技术可以帮助你,请参阅另一篇文章:
Eclipse buildpath automatically taking all JARs of a internal directory Eclipse buildpath自动获取内部目录的所有JAR
The reason it works like this for your JSP's is because that is how the Dynamic Web Project was made to behave. 它为你的JSP工作的原因是因为动态Web项目的行为方式就是这样。
"If you remove a library path entry but not the JAR file, the library entry will be re-added to the path automatically." “如果删除库路径条目但不删除JAR文件,则库条目将自动重新添加到路径中。” from http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse.wst.webtools.doc.user/topics/ccwebprj.html
来自http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse.wst.webtools.doc.user/topics/ccwebprj.html
You could adopt Maven and use the Maven Eclipse Plugin ; 您可以采用Maven并使用Maven Eclipse插件 ; this plugin would update your classpath whenever you add a dependency.
每当添加依赖项时,此插件都会更新您的类路径。 There may be a similar plugin for Ivy .
Ivy可能有一个类似的插件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.