Home > JavaEE > Skinny WAR done right

Skinny WAR done right

In a previous post, I wrote about how to create skinny WAR with Maven the DRY way: it was not the DRYier way to do it, as was demonstrated to me this week by my colleague Olivier Chapiteau (credit where credit is due).

His solution is far more elegant; it is reproduced below for reference’s sake.


  ...
  
    
      ch.frankel.blog.ear-war
      war-example
      1.0.0
      war
    
    
      ch.frankel.blog.ear-war
      war-example
      pom 
      1.0.0
    
  
...

That’s it! The beauty lies in using the WAR’s POM as a dependency as well as the WAR itself: it’s simple, DRY and effective.

email
Send to Kindle
Categories: JavaEE Tags: ,
  1. Marcel Ammerlaan
    September 28th, 2011 at 22:59 | #1

    Brilliant trick! Did you encounter any (bad) side effects?

  2. September 29th, 2011 at 08:53 | #2

    Well, the trick is not mine. As for side-effects, it just works!

  3. john
    August 21st, 2012 at 23:02 | #3

    @Marcel Ammerlaan
    Here’s one negative side effect: Any dependency having ‘provided’ scope is included in the ear’s /lib directory. Other than that, this is brilliant.

  1. No trackbacks yet.