aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes Jarmageddon Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Jarmageddon" Watch "Jarmageddon" New topic
Author

Jarmageddon

Billy Vandory
Ranch Hand

Joined: Mar 23, 2010
Posts: 57
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

Joined: May 26, 2003
Posts: 31062
    
232

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.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Yeah; 30 seconds shouldn't be an issue--consider what's being done.
Billy Vandory
Ranch Hand

Joined: Mar 23, 2010
Posts: 57
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

Joined: May 26, 2003
Posts: 31062
    
232

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

Joined: Jun 25, 2001
Posts: 16305
    
  21

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

JRebel is another tool that might assist you here.


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Jarmageddon