Maven - GWT - Vaadin - including additional custom jars in a maven project under "\web-inf\lib" | MyThinkPond

With a lot of folks trying Google Web Toolkit (GWT) and\or Vaadin (combined with Maven), one of the problems that they might encounter is this:

How do I get my custom Vaadin themes or GWT jar files included under my "\web-inf\lib" folder inside the war

Here’s a link to the such a question in detail.

The answer is a lot simpler than you think. But before we explore the answer, I should warn you that this approach is going away from what Maven would like you to do. In Maven, you can take each of your jars\libraries and add them to your local repository and then include them as needed in your projects. If you want to go the proper route here’s how you do it. This keeps a consistent version in all your projects and can allow you to gracefully update the library as new versions become available.

But if you still want to go ahead and add these custom jars in your project then follow these steps:

  1. Create a “lib” folder under your project like this: “\src\main\webapp\WEB-INF\lib”

  2. Copy needed “jars” etc that you want included inside your WAR bundle folder.

  3. Invoke your maven build as you normally do. I use “mvn install”, which creates builds the war file.

If you examine the WAR file, your jars that you included in step-1 and step-2 will be there.

By the way, have you tried Vaadin lately? To summarize my experience with Vaddin… “It’s a breath of fresh air. Simple. Elegant. Concise.”


Venkatt Guhesan avatar
About Venkatt Guhesan
Enterprise Software Architect currently working at DataDirect Networks developing a highly scalable monitoring solution called DDN Insight. My passions include all things Open Source including Linux (CentOS, Red Hat, Gentoo, Open Stack, Docker & Ubuntu), embedded ARM processors and microcontrollers (Arduino, UDOO, Cubieboard, BeagleBoard, OnionIO, TI's Zigbee). Coming from an Electrical and Computer Engineering background, working in developing and designing enterprise - distributed, highly scalable software requires a unique set of software skills with a good understanding of the hardware. This makes his work challenging and interesting. In his free time, he spends his time with his family and two children. He also enjoys researching on topics including - world ancient history and yoga. Visit the 'About' section for more details.
comments powered by Disqus