Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Optimizing Exporting of Libraries
Optimizing Exporting of Libraries [message #206898] Wed, 16 January 2008 23:58 Go to next message
Richi Plana is currently offline Richi Plana
Messages: 11
Registered: July 2009
Junior Member
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 #206906 is a reply to message #206898] Thu, 17 January 2008 00:10 Go to previous messageGo to next message
Eclipse User
Originally posted by: kosta.bea.com

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.

- Konstantin
Re: Optimizing Exporting of Libraries [message #206913 is a reply to message #206906] Thu, 17 January 2008 00:54 Go to previous message
Richi Plana is currently offline Richi Plana
Messages: 11
Registered: July 2009
Junior Member
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
Previous Topic:Working with JSP Fragments
Next Topic:xDoclet and oc4j task
Goto Forum:
  


Current Time: Wed Oct 01 04:10:12 GMT 2014

Powered by FUDForum. Page generated in 0.01650 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software