Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Jarmageddon

 
Billy Vandory
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can someone tell me best practice for when there are a lot of jar dependencies for a webapp (war/ear/ejb)? My ear file takes 30 seconds to build because of all the jars. Can I put the dependencies into the app servers lib directory so that i dont have to package them in the ear file? i use maven's <scope> to indicate 'included' but when i build my ear from eclipse it ignores that scope, but thats another issue. My main question is, is there an alternative to bundling all the dependencies in a war file each time I deploy ?

Thanks,

Billy



 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34973
379
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Billy,
A 30 second build isn't excessive for a big application. Do you know where the time is going? It could be "real" or an artificial slowness. For example, you could speed things up by being more incremental about what you do in the build.

While you could put the jars outside the jar, it introduces configuration management problems and I wouldn't recommend it.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah; 30 seconds shouldn't be an issue--consider what's being done.
 
Billy Vandory
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David Newton wrote:Yeah; 30 seconds shouldn't be an issue--consider what's being done.


Sorry, I should have been more specific as to what i am doing; During development, to test my changes, I publish via WTP to the app server. this is what's taking 30 seconds (creating the ear file with all those jars) .. I like to test in small increments, so I find I wait a lot..


I was looking for a shortcut during the development stage. A 30 second build for sit/uat/pat/prod would actually be a blessing :)

 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34973
379
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Billy,
That is an easier problem!

Most application servers provide an option for an "exploded" ear. This means they unzip the ear and store in some directory. Other servers provide this by default.

With an exploded ear, you can just FTP the jar that has changed. After that, some servers require a restart; others just pick it up. Either way, it's a lot less than 30 seconds.
 
Tim Holloway
Saloon Keeper
Posts: 18304
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is extremely perilous to put application jars in the common directory of a webapp server. The code and resources in them may not have been designed for the uniquely stressful situation where multiple threads are accessing them through different classpaths.

As Jeanne pointed out, you can save the time spent on jarring everything up if your appserver supports exploded WAR/EAR files. In fact, some appservers will do you an even bigger favor and run exploded WARs straight from your project directory's build area, eliminating the need to copy the exploded EAR to the appservers directories (or to build straight into the appserver).

Tomcat is one of the above, and I've used that feature for years.
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JRebel is another tool that might assist you here.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic