Win a copy of Building Blockchain Apps this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

how to refer to jar files of an external war

 
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am working on a GWT application and I create a WAR file to deploy it on my Tomcat server. But as with all GWT projects the size of the project is way too much. Hence I read a few artciles to move all dependency files (js files) to a separate application. I did that and all is well.

But I want to know that is it possible to move all my jar files inside WEB-INF/lib, of my main project (say ProjMain.war) to a separate WAR file altogether (say LibProj.war). And have my main application (ProjMain.war) somehow refer to jar files in this separate WAR file (LibProj.war) ?

Is this possible ? If yes could you please explain me the technique to do this.

If I can do this it will reduce my main applications size considerably.

Please help.
 
JavaMonitor Support
Posts: 251
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Praveen,

Web apps should be independent entities. That is their design as laid out in the JEE spec. So what you want to do is a bad idea.

If you have code that needs to be identical in both project, put that into a JAR and copy it into each WAR. Beware of version issues.

If you need run-time singletons that are singleton across the two WARs, you should make one WAR.

Most likely, you are trying to make modules of your code and that is not what a WAR is designed to do. It is designed to take a set of modules (JAR) and bundle them into a coherent, independent whole.

Kees Jan
 
Praveen Sharma
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Kees,
Thank you for the reply. Maybe I was thinking selfish.
I was only worried about the project size without thinking about the design issue.
 
That's my roommate. He's kinda weird, but he always pays his half of the rent. And he gave me this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!