Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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,

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
396 views
Welcome To Ask or Share your Answers For Others

1 Answer

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...