Eclipse在WAR中导出JAR [英] Eclipse exporting JAR in WAR
问题描述
谢谢,
确定在战争中发生什么的机制不是正常应用程序的构建路径,而是部署程序集。
右键单击动态Web项目的根节点,然后选择属性,然后选择部署。在这里,您可以添加项目(这些项目被添加到WEB-INF / lib中)和项目中的单个jar。
编辑2015-08-20:几年后,Maven已经成为构建基于Java的软件的标准方式主要是由于基于脚本的依赖关系管理方法。这包括如何构建WAR文件,并且三个主要的IDE(IntelliJ,Netbeans和Eclipse)完全支持这一点,可以在IDE的开发过程中进行切换。在Eclipse中,这里提到的问题将不适用,因为这完全由Maven插件控制。
I have two projects in eclipse, a library project producing a Jar file and a web project dependant on that Jar. How do I get the web project to export the first projects jar in its war automatically. I know this must have been answered before, but I really cant find it.
Thanks,
The mechanism to determine what goes in the war is not the build path as for "normal" applications, but the "Deployment assembly".
Right-click on the root node of the dynamic web project, and select Properties, and select Deployment assembly. Here you can add projects (which are jarred up and added to WEB-INF/lib) and individual jars in the project.
EDIT 2015-08-20: A few years later, Maven has become the standard way to build Java-based software primarily due to the script based approach to dependency management. This includes how to build WAR-files, and the three major IDE's (IntelliJ, Netbeans and Eclipse) fully support this allowing you to switch between IDE's while developing. In Eclipse the problem asked here will not apply, as this is fully controlled by the Maven plugin.
这篇关于Eclipse在WAR中导出JAR的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!