Optimizing Exporting of Libraries [message #206898] |
Wed, 16 January 2008 18:58  |
Eclipse User |
|
|
|
Hi,
Given the following projects:
- a Java Project (Java1) which requires jar1.jar, jar2.jar, jar3.jar and
jar4.jar
- a Dynamic Web Project (Webapp1) which requires Java1, jar2.jar,
jar3.jar, jar5.jar and jar6.jar
- another Dynamic Web Project (Webapp2) which requires Java1, jar3.jar,
jar4.jar, jar6.jar and jar7.jar
- an Enterprise Application project (Entapp1) that contains Webapp1 and
Webapp2
Is there a way to optimize the exporting of the libraries
(automagically) in Entapp1 so that only it contains JARs jar[1-7].jar
and have them all available to both web apps?
Currently, I have Eclipse automatically exporting the dependency JARs of
Java1 in both Webapp1 and Webapp2's /WEB-INF/lib/ subdirectories.
--
Richi Plana
|
|
|
|
Re: Optimizing Exporting of Libraries [message #206913 is a reply to message #206906] |
Wed, 16 January 2008 19:54  |
Eclipse User |
|
|
|
Konstantin Komissarchik wrote:
> Sure.
>
> Rather than referencing these jars as local web app libraries (second
> tab of the J2EE Module Dependencies page for a web project) you can add
> them as modules in the EAR (using the J2EE Module Dependencies Page of
> the EAR project). Then come back to the web projects and use the first
> tab of the J2EE Module Dependencies Page to specify that your web apps
> have a dependency on these modules.
>
> This approach will place jars in ear root and war archives will
> reference them via manifest classpath.
Thanks. That's exactly what I needed! However, after following your
instructions and adding the two web apps as dependencies of the
enterprise app, clicked Ok then reloaded the Properties page, it only
seems to "pull in" (dependencies with greyed-out and ticked checkboxes).
Adding the Java project as a dependency did the trick.
However, the resulting EAR file doesn't seem to contain the JAR files
(neither in the EAR file nor in the WAR files). I re-checked the EAR
properties page and J2EE Module Dependencies and sure enough, all the
extra JAR libs were present (greyed-out and ticked).
Am I missing something? How do I troubleshoot this?
--
Richi Plana
|
|
|
Powered by
FUDForum. Page generated in 0.04664 seconds