Results 1 to 3 of 3
- 04-02-2009, 11:31 PM #1
Member
- Join Date
- Apr 2009
- Posts
- 3
- Rep Power
- 0
Library JAR projects and including them in other projects
It is a very common practice to create library projects whose final output is a JAR, and then to include those JARs in other projects (like a Web project).
In Eclipse I found it easy to create those projects and even setup dependencies so that compilation happens correctly. But I have not found an easy way to:
(a) Make the library project automatically generate the JAR. I have been able to manually create a JAR by Exporting from a Java project, but it is a hassle when you are in a rapid enhance/rebuild/test cycle.
(b) Tell a Web project to automatically include the library JAR from the other project into WEB-INF/lib during deployment.
This was trivial in Netbeans because of its Ant-based build mechanism. I presume that even without switching to Ant builds in Eclipse it is probably still trivial... so, how do you do it?
- 04-03-2009, 08:42 AM #2
Member
- Join Date
- Apr 2009
- Posts
- 37
- Rep Power
- 0
build.xml file is use to create the jar file and also create folder web-inf and put the compiled files
- 04-03-2009, 03:03 PM #3
Member
- Join Date
- Apr 2009
- Posts
- 3
- Rep Power
- 0
build.xml 'is' the Ant build file. Of course it is the most flexible approach, even though it is not Eclipse's default. My question was about whether there is a 'default' way to accomplish it without having to switch to the optional Ant build mechanism.
For example, since my post I found a partial solution. If the project that depends on the library projects is a JEE (WAR or EAR) project, setting the 'Java EE Module Dependencies' in the properties will create the JARs from the dependent projects and place them in WEB-INF/lib.
But I am not sure if that answers the generic question of dependencies between library projects (that should produce JARs) and application projects (that should use them). Perhaps switching the build mechanism to the optional Ant (or Maven) are the only answers within Eclipse.
Similar Threads
-
Java Projects
By yiweiang in forum New To JavaReplies: 2Last Post: 12-15-2011, 01:28 AM -
projects using jms
By Parneel in forum Advanced JavaReplies: 0Last Post: 03-31-2009, 07:56 PM -
Plug-In Projects
By ciigma in forum EclipseReplies: 0Last Post: 02-16-2009, 06:07 PM -
Projects please
By sudhir in forum IntroductionsReplies: 1Last Post: 12-17-2007, 01:42 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks