Small steps with big feet
My most played ios games of 2011
The past year, the Apple marketing machine finally cracked me. From being a linux fanboy, I switched completely. I now provide shelter for a MacBook, iMac, two iPhones and two iPads. Anyway, I love these machines, and the appstore already has made a good profit on me. I use the iPad practically every day, mostly for reading books and reading stuff on FlipBoard. As I’m also an avid gamer, here’s my top 5 of ios games I played the most the past year.
5. Majesty: The Fantasy Kingdom Sim (iPad)
Majesty is a port of a pc title from around 2000. The cool thing about Majesty is the non-traditional approach to the typical strategy paradigm. Instead of building stuff, train units and move these units around to attack your enemies, you put out rewards and bounties. You want a certain ‘Lair of Zombies’ gone? Put up a decent bounty, and your troops will definitely go after them. You build the infrastructures (houses, barracks, etc.), but you don’t control what the troops do.
Majesty felt pretty short (around 10 missions, some of them around 1 hour to finish), but you can replay the levels on harder difficulty and unlock extra levels. Kept me thorougly enjoyed, so definitely worth the money.
4. Neuroshima Hex (iPad)
iPad adaptation of the board game. I’m a big fan of board games, and definitely if mixed with some fantasy/sci-fi. NeuroShima Hex offers both. Altough I typically prefer the non-digital versions of board games (call me old-fashioned), Neuroshima is an exception. It is a very fast-paced game, and the cpu really helps in checking all the rules and not forgetting any unit (which I would imagine, happens probably in the real version). Very crisp and fitting graphics. The single player is ok to practice, but I prefer playing it with real people. The multiplayer supports up to 4 persons, and you just put the iPad in the middle of the table.
Certainly not for everyone I would think, but if you are into board games with a fantasy/sci-fi theme … don’t even think of not buying it!
3. Jetpack Joyride (iPhone/iPad)
I admit, I’m a Halfbrick Studio fan. I buy every games they put on the app store without reading any review (I also love Raskulls on the Xbox360!). Jetpack is the latest game of Halfbrick which I bought on the release date. Since then, I think I play it at least every three days. The goal is simple: bring our hero – Barry Steakfries – as far as possible using a jetpack (or one of his cool vehicles) while dodging fire, rockets and other malious things that want Barry dead. Yes, it’s pretty much the same as Monster Dash – except you’re flying now, but I don’t care. I just love the humor and the pick-it-up-and-play-ability of the game.
The developers also totally rock, as they keep adding stuff to the game with every update. The latest update – the Christmas update – included for example a jetpack that is actually a christmas tree that blows christmass balls to keep Barry in the air.
If you don’t have it – seriously ? – go get it! At the time of writing it’s even free!
2. Game Dev Story (iPhone)
Game Dev Story is a ‘game company simulation’ game. You start out with one or two crappy developers in a small brick garage, and must code, market and sell games until every game you produce brings in the millions of dollars. There are plenty inside jokes in the game if you know a thing or two about gaming history.
The game is challenging in the beginning, but once you pass the million mark for a game, it gets pretty easy. Still, the game is incredibly addictive, and I have spent way too many hours with the game.
1. King of Dragon Pass (iPhone)
King of Dragon Pass (kodp) is a difficult game to describe. It is a mix of RPG with create-your-own-adventure and civilization. Basically, you are the leader of a tribe in Dragon Pass. The end goal is to become the king, uniting the tribes living in Dragon Pass. You start out with a few people, some warriors, sheep, cows and food to last for the first year. From there on, it’s up to you. You can be agressive, and try to drive away your neighbours with force. But that won’t help a lot in the long run, as the other tribes won’t likely will make you King.
The game proceeds in the seaons of one year, and every season you can choose a certain action (harvest your crops, send out warriors, go exploring, go trading with some other tribe, and many other things). Also, every season some event can occur. These can be not important, like a married couple in your tribe is is publicly fighting. But they can also have a serious influence on the future game. For example, in the beginning of the game one of my tribesmen stole a horse from another family of another tribe. This dispute went on for many years, and even after the original members of the familiy had all died, the kids went on fighting, eventually ending in the death of many of both tribes as they were dragged in a big battle. If I would have given back the horse in the first place many years before, I would have saved many of my people in the long run. Not to say my relationship with that tribe was damaged forever.
The learning curve is very high. You really have to read a lot of text, and learn and understand the lore and universe of KODP or you simply will lose all of your games (and you will lose your first games).
But the game is really rewarding and freaking huge for an ios game. I put in around 30-40 hours already, and I didn’t yet make it to king (almost there, I swear!). Replayability is baked in the core of the game. It’s a bit pricey for an iPad game. It’s definitely for a niche market (dare I say even a niche in the ‘geek market’), but if you’re into this stuff it is worth every penny!
Altough it is an iPhone game, I play it on the iPad using the magnifier. There is just too much text to make it comfortable in the iPhone. But the developers have promised a universal version soon! Damn, there goes my sleep again….
Installing GWT development plugin in Firefox 8/9
Update 16/01/2012: The explanation below was for Firefox 8. In the meantime, Mozilla updated FF to version 9, and invalidated the plugin. Luckily someone compiled a new version for FF9, which I uploaded to my webspace: http://jorambarrez.be/files/blog/gwt_dev/ff9/gwt-dev-plugin.xpi. The description below is still valid for this plugin.
I’ve been looking to get the GWT development plugin working on Firefox ever since I started my fiddling with GWT. Through various sources, I learned that dev mode in Firefox is much faster compared to Chrome. However, due to the crazy upgrade schedule of Firefox (a new version every six weeks), the GWT development plugin hasn’t been working on Firefox since version 6. Which meant we were condemned to use Chrome until the GWT dev mode add-on for Firefox was updated.
Good news everyone!
This morning while Googling to see if there was a fix already, I found a discussion by some of the GWT developers.
In that discussion, there is a link to a ‘trunk-build’ of the dev mode plugin for Firefox 8: http://www.fileswap.com/dl/1OVPVHwWEp/gwt-dev-plugin.xpi.html. I’ve also uploaded the file to my webspace, if it should be down for some reason: http://jorambarrez.be/files/blog/gwt_dev/gwt-dev-plugin.xpi.
Simply select ‘install from local file’ in the add-on management view, and you’re good to go. I tested this on a Macbook Pro, Firefox 8.01, and it works like a charm here. Dev mode in FF is way more faster compared to Chrome. Plus, I can now use my beloved web developer add-on and FireBug!
Firefox auto-upgrade
To avoid that this setup is broken again in six weeks, be sure to set Firefox auto-upgrade to non-automatic (Preferences -> Advanced->Update). A screeshot (in Dutch, sorry) is below.
Hopefully the GWT dev plugin team finds a workaround for the Firefox upgrades soon!
Terry Pratchett: Choosing to die
I rarely post non-technical stuff on this blog. When I do, you can be sure it is something really worth it.
The documentary below this text is touching and sad in a strange way. It spooked through my mind for several days after watching it. I wouldn’t recommend it if you are feeling down at the moment.
Terry Pratchett (yes, Discworld-Terry Pratchett) explores a rather difficult subject: medically assisted death. Having been diagnosed with Alzheimer’s disease in 2008, Terry considers how he might choose to end his life as his condition progresses. In this moving documentary he meets those who, like him, would like to control the way they die including a men suffering from degenerative conditions and he is with a British motor neurone sufferer as he carries out an assisted death at the Dignitas clinic in Switzerland.
( source: http://documentary.net/terry-pratchett-choosing-to-die-medically-assisted-death/)
Devoxx 2011 Impressions
Devoxx 2011 is over, and it was awesome. Finally, after having to spend the weekend with wife and kid (haven’t seen much of me the last week
), I’ve found the time to write down some stuff. It was for me the sixth Devoxx, my first one being in 2006 – back when I was still a student and it was called Javapolis. So obviously I have some tradition with Devoxx, which grants me to say that (at least for me) it was one of the best editions ever. It may have to do with the fact I didn’t have a talk this year (Frederik had that honour), and I could enjoy the conference at its fullest. That said, time for a wrap-up!
Java == boring?
From a first glance at the Devoxx schedule it was clear that Java was not the first-class citizen it used to be on Devoxx. Dynamic languages, Android and HTML 5 were this years favourites. And, in my opinion, the organisators have decided wisely. We’re past the time that every new Spring, Hibernate or JBoss version drive cool and innovative features. EE6 and its features are well told and understood by now. UI frameworks have come and gone (byebye, JSF!). If you think about it, what ‘big hot item’ has happened in the last year in Java land? … Exactly.
And that in itself is not a bad thing. Java is as mainstream as mainstream can get. Solid, stable and here to stay for a long time (almost sound like Cobol … ). Sure, there is plenty of opportunities and work to do if you’re a Java developer. But we have to admit that we’re not amongst the hottest of the hottest these days (and probably have been like that since the advent of Ruby on Rails
). Which is why some polyglotism and peeking around other technologies can’t hurt, if you’d ask me.
University days
I attended Devoxx during both Uni and Conference days. For me personally, I found the Conference sessions wildly more interesting than the Uni talks. Three hour talks are just not my cup of tea. There just too much technical depth and information in these talks. I rather read a book on my own pace than trying for three hours to frantically follow every slide of the talk. Lessons learned for next year.
One exception: I really liked the Android Jumpstart talk by Lars Vogel. I have some IOS development experience, and seeing how straightforward Android development is, was interesting to say at least.
Keynote: next year not Oracle, pretty please?
I think everybody wholeheartedly agreed that the keynote(s) on Wednesday by Oracle were boring as hell. I had high expectations when the first Oracle guy started with the obligatory Oracle Disclaimer, but invited the audience to find the spelling mistakes he added on purpose. But it was downhill from there. Nothing new in the presentations, slides obviously originating from sales and marketing, frantically avoiding the ‘Android’ word (J2ME will be and important focus in the future … uuuh yeah, right!).
I mean, these guys get a golden plated chance to get on the stage and show the tech audience that they rock as being the new steward of Java… Anyway, enough words written on this topic. The fact I saw several people sleeping in their seats speaks for itself.
Keynote: but Google can certainly return!
The Android keynote by Tim Bray on Thursday luckily was of a different kind. Great speaker (been following his blog since I discovered Ruby on Rails years ago), humorous, a new feature with examples here and there (I’m an IPhone guy, but hell Android sure has some sweet stuff up it’s sleaves!) and a real ‘call-to-action’ at the end (got the whole room very, very silent). I was in doubt to get up early again to go to the keynote after the debacle of the day before, but it sure was worth it.
On a sidenote: Stephan’s keynote (this year announcing Devoxx France!) was as good as ever. He can definitely return next year
Sessions: too much choice!
The hardest part about Devoxx is the choice. With seven talks going on in parallel, on has to choose. And sometimes I had three sessions picked at the same time… damn! Luckily, all talks should be on Parleys by Christmas (and every Devoxx attendee gets access to it!).
I saw plenty sessions during Devoxx, but some of them really stood out:
Activiti + Vaadin, A match made in heaven
![]()
No suprise here
My fellow Activist Frederik did a great co-op presentation with the Vaadin guys. Both Activiti and Vaadin are of course enormously cool frameworks, so the combination surely gives some firework. There were some nice (new) features in the talk too, which they kept secret until the talk (like the annotations to match a form with a Vaadin view). Someone in the audience taped the whole talk and has put in on Youtube. Enjoy!
Java: The Good, the Bad, and the Ugly Parts by Joshua Bloch
As Joshua Bloch his sessions tend to be the most popular ones (last year, I could’t get in), I made sure to be good in time. The content of the talk was an overview of basically JDK 1.0, and what was in there that helped Java to be where it is today, and what might have hindered it. As you would expect from him, some nice puzzlers thrown in between. One of the best speakers out there, and really knows his stuff.
PhoneGap for Hybrid App Development by Brian LeRoux
I only knew the idea behind PhoneGap, so this session was exellent to soak up some information. Brian is an awesome speaker, typical start-up attitude with the obligatory cursing and quotes to remember. Altough his demo’s (except one) didn’t work due to his Mac not seeing his Android, followed by cursing adb and all that is holy, I understood the goal and value of PhoneGap. I was really impressed by PhoneGap Build, a cloud environment where you upload your HTML and Javascript, and it gets compiled to every platform you wish (even Blackberry). The demo went well this time, and after uploading his example html, he could just scan the QR code on his screen and the app got installed on his phone. Sweet!
People who work with me in real-life, know that I’m fan of blaming others for yak shaving. Brian’s slide on ‘serious business time’ couldn’t have said it better
Meh! It’s only cross site scripting what’s the big deal? by Cambell Murray
I had expected a technical talk, but we rather got juicy examples and stories about customers (anonymous of course) on security bugs that lead to huge problems. Really great speaker. It was as if he was just was at a bar and talking while having a beer. It was a clear eye-opener that there is a world outside our comfortable Java code where hackers and criminal entities are extremely inventive and do stuff which we as ‘normal’ developers would never have tought of.
Rules for Good UI Design by Joe Nuxoll
This session was placed in one of the smaller rooms, but this quickly proved to be a mistake. In no time the room was complety packed, and people sat everywhere they could. This is really a good sign that developers are understanding the need of UI design.
Joe is an UI designer for the Tesla S interface who used to work for Apple (which might have helped for the session’s popularity), and the examples were of course chosen from that background. The first part of the talk was a tid boring (but I already read quite a bit on the topic), but the second part was full of examples and tips.
The audience size definitely proves that Java Developers are evolving too.
WWW: World Wide Wait? A Performance Comparison of Java Web Frameworks by Stijn Van den Enden (and others)
I know Stijn personally, so choosing his session was a no-brainer. Again, the topic proved to lure a lot of people, and the room was very fast sold out. The talk took the session of Matt Raible of last year on Devoxx as starting point, but added real numbers and more importantly, real math to the table. Five frameworks (GWT, Wicket, JSF -2 implementations- and Vaadin) were put to the performance test. The performance architecture was thorougly explained, as were the measurment calculations/validations and potential pitfalls. Very profesionally brought.
Big winner of this test was GWT, albeit needing most of coding compared to the other. My framework of choice, Vaadin, did very well, and in a chat with Stijn later on he also expressed that the rapid development of Vaadin makes it a framework to consider.
JSF was the big loser of the day (at least the MyFaces impl, the Mojarra was better), and proved to scale much, much worse than the others. I had a French (or was it Spanish) project lead sitting next to me, who had expected validation for his ‘choosing the standard’. His sighs and painful yelps with every new graph shown on screen almost made me have compassion.
The networking
No, I’m not talking about the Wifi (which was horrible), but rather meeting people. As every past edition, Devoxx is a great way to meet up with many people of the Java eco-system. I met a lot of old friend, ex-collegues and met some new people. That alone is worth the trip to Antwerp.
Devoxx 2012
Devoxx 2011 was great in every way, and for me it still is the best conference out there – period. Looking forward to next year!
My Git workflow
The last months, I’ve been quite heavily using Git. After the initial hurdles, swearing and cursing, I fell in love with it and switching back to Svn is now a pain.
Git is extremely powerful and flexible, and this is exactly the major cause of headaches in the beginning to get your ‘flow’ as you want it. I read a lot of people’s blogs documenting their git workflow, and came to my ‘own’ workflow (which is hugely based on a very excellent blogpost which I can’t seem to find anymore now), which I wrote on a piece of paper lying on my desk. As that paper is getting more coffee-stains by the day, I finally decided to write my flow down here – more for my own documentation purposes than anything else. And hey, maybe somebody might find this useful.
If you are starting out with Git, get a Github account. Github is simply brilliant.
I’m using command-line only, but other people on the team are quite happy with Egit. For me, it magicfies things too much. The following steps asume that you have already initialized your local and remote Git repo. If not, just create a new Git repo on Github and follow the instructions there.
First of all, make sure your local copy is to date with the remote repo:
git pull
This git ‘pull’ takes all changes from the remote master branch, and applies it to your local copy. I like to keep my local master branch clean, and exactly in sync with the remote master. This way, I always have a stable version of what I’m working on. Also, if other people push stuff to master, I can easily pull it in and see what changes without having to merge to see what they did. This said, I create a branch for doing my actual work. This can be a general ‘dev’ branch or a branch for a specific feature implementation:
git checkout -b cool_feature
This creates a new branch called ‘cool_feature’ and switches to it. All changes I now to, are done in this branch. Regular, I commit stuff to my local repo
git add .
git commit -m “implemented part 1 of the cool feature”
The ‘add’ command, allows to specify which files you want to prepare for the commit. 99% of the time, I just add the dot, meaning every change should go in the commit. Often, I also use the ‘- -amend’ flag, to merge this commit with the last commit. Otherwise, you’ll have a lot of smaller commits (which is also good, but I don’t like it).
When I feel that my work is complete and all is working dandy and fine, I need to push it to the remote master branch so that the other teammembers can see its awesomeness. To do this, you need to switch to the master branch, and pull any incoming changes (this always works, as I don’t do any changes on master). Then, switch back to the branch, and merge these changes using a ‘rebase’ (this makes the commit history lineary, which is nice).
git checkout master
git pull
git checkout cool_feature
git rebase master
Potentially, merge conflicts now arise. You can resolve these in text-mode in the files itself, but I like a graphical merge tool more. I’m using p4merge for this purpose, and I’m really happy with it. To resolve merge conflicts, execute
git mergetool
Now it is time to merge your branch with the local master branch, and push the changes to the remote master.
git checkout master
git merge cool_feature
git push
And that’s it!
Imo, still one thing needs to be optimized in my flow: I don’t like to have many local commits which are not on a central repo. You never know when my laptop might burn out. To solve this, need to push my local branches to as remote branches to Github. But I still need to make that a habit and I tend to forget it.
Activiti KickStart moved to GitHub
As of Activiti 5.7, KickStart is no longer part of the ‘official’ Activiti dsitribution.
KickStart has always been a prototype, which I wrapped up in a short amount of time to prove the point that creating simple BPMN 2.0 compliant processes can be done with a very simple UI. However, as we are focussing our efforts in Activiti in building and maintaining the best workflow/BPMN2.0 engine, KickStart doesn’t fit in that picture.
As it would be a waste to just throw away the code, I moved the KickStart code to GitHub, url is https://github.com/jbarrez/Activiti-KickStart. I’m sure that some people will find the UI to JAXB to executable BPMN 2.0 processes useful. I do plan to spend free time on it in the future, for practising my coding kata’s
. Anyone interested in contributing is surely welcome!
Screencast: New Activiti Explorer
One of the highlights of the latest release of Activiti, is absolutely the new revamped (= redesigned and rewritten) Activiti Explorer app. In the screencast below, I’ll give a quick tour of the app.
Activiti Explorer (The Next Generation) has all the features of the previous version. Some new features include (but not limited to) support for
- Different types of task lists
- Event stream
- Comments
- Standalone tasks
- Subtasks
- Attach any content to a task
- Process instance view
- Administration (previously found in Activiti Probe)
- Profiles
More info & screenshots can be found in the Activiti userguide.
For the tech people: the app has been completely rewritten using Vaadin (you might have noticed we’re big fans). The source can be found in the Activiti svn repo.
Screencast
Make sure to set the screen full-size, and change to 720HD (Youtube doesnt allow embedding it as HD and changing the size at the same time – sorry!)
Cool new features in Activiti Designer
Tijs Rademakers (already 2 months full-time Activiti team member now … time sure flies!) posted on his blog an overview of some new features in the latest Activiti Eclipse Designer release. All features are demonstrated with a short movie, so it’s all very digestable
.
I’m a huuuuuge fan of the quick edit feaure! This is really a productivity booster.
An interview with the Activiti team on Vaadin
The Vaadin guys recently did an interview with us on how we are rocking the productivity-waves with Vaadin, check their blog to read all about it!
How to: Vaadin add-ons and Maven
Introduction
One (of the many) thing I like about Vaadin, is its community of ‘add-ons’ to the Vaadin framework – what they call the Vaadin Directory. An ‘add-on’ is a community-contributed addition to the framework, and can be anything from for example a new client-side widget to a Lazy loading container for a data table. Something similar I would definitely like to see for Activiti!
Vaadin widgets are basically precompiled GWT widgets. GWT widgets on itself are Java classes, but the GWT compiler compiles them to Javascript that works accross all browser. So, when you want to use a certain add-on (that has new client-side visuals) in your Vaadin webapp, you will have to compile them yourself since you must include the new Javascript in your webapp.
If you are using the Vaadin Eclipse plugin, all is happy and fine. Just add the add-on jar to your project, and the plugin autodetects and compiles the new widgets. However, when your webapp is built using Maven, it’s not that simple. But throwing out Maven and manually copying all your dependency jars is not necessary at all. It’s 2011 after all.
The default way of doing the GWT compilation in Maven is, in my opinion, not efficient. So let me guide you through what setup works the best for me and how I tweaked the Maven pom.xml.
For the impatient-ones: check the source on github: https://github.com/jbarrez/vaadin-mvn-addon
Creating a new Vaadin webapp with Maven
This step is well-documented, just check the Vaadin wiki.
Short version: use following archetype:
mvn archetype:generate -DarchetypeGroupId=com.vaadin-DarchetypeArtifactId=vaadin-archetype-clean -DarchetypeVersion=6.5.6 -DgroupId=com.jorambarrez -DartifactId=vaadin-mvn-addon -Dversion=1.0 -Dpackaging=war
Add the add-on
In this example webapp, I’m going to use two cool Vaadin add-ons:
- Paperstack: a container that allows to display components as pages of a book
- Refresher: a client side component that polls the server for UI changes
Both add-ons have new client side widgets, so a run through the GWT compiler is definitely needed.
Tweak pom.xml
Open up the pom.xml. The archetype already generated all you need to work with custom add-ons. Look for commented sections, and just uncomment them. That’s all there is.
Create the webapp
The following Vaadin webapp shows a simple use of these two components. We’ll just display ‘Activiti’, with each character on a new page of the paperstack component. We also have a button, that will auto-flip through the pages using the Refresher component and a server-side thread:

public class MyVaadinApplication extends Application {
private static final String DISPLAYED_WORD = "ACTIVITI";
private Window window;
private Refresher refresher;
private Button goButton;
private PaperStack paperStack;
@Override
public void init() {
window = new Window("My Vaadin Application");
setMainWindow(window);
initGoButton();
initPaperStack();
}
private void initGoButton() {
goButton = new Button("Flip to the end");
window.addComponent(goButton);
goButton.addListener(new ClickListener() {
public void buttonClick(ClickEvent event) {
goButton.setEnabled(false);
startRefresher();
startPageFlipThread();
}
});
}
private void startRefresher() {
refresher = new Refresher();
window.addComponent(refresher);
refresher.setRefreshInterval(100L);
}
private void startPageFlipThread() {
Thread thread = new Thread(new Runnable() {
public void run() {
goButton.setEnabled(false);
int nrOfUpdates = DISPLAYED_WORD.length() - 1;
while (nrOfUpdates >= 0) {
paperStack.navigate(true);
nrOfUpdates--;
try {
Thread.sleep(2000L);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
// Remove refresher when done (for performance)
goButton.setEnabled(true);
window.removeComponent(refresher);
refresher = null;
}
});
thread.start();
}
private void initPaperStack() {
paperStack = new PaperStack();
window.addComponent(paperStack);
for (int i=0; i<DISPLAYED_WORD.length(); i++) {
VerticalLayout verticalLayout = new VerticalLayout();
verticalLayout.setSizeFull();
paperStack.addComponent(verticalLayout);
// Quick-hack CSS since I'm to lazy to define a styles.css
Label label = new Label("<div style=\"text-align:center;color:blue;font-weight:bold;font-size:100px;text-shadow: 5px 5px 0px #eee, 7px 7px 0px #707070;\">" + DISPLAYED_WORD.charAt(i) + "</div>", Label.CONTENT_XHTML);
label.setWidth(100, Label.UNITS_PERCENTAGE);
verticalLayout.addComponent(label);
verticalLayout.setComponentAlignment(label, Alignment.MIDDLE_CENTER);
}
}
Tweak web.xml
To make Vaadin aware of the custom add-ons, add following lines to the Vaadin Application Servlet:
<init-param> <param-name>widgetset</param-name> <param-value>com.jorambarrez.CustomWidgetset</param-value> </init-param>
Also add a file ‘CustomWidgetset.gwt.xml’ in the package com.jorambarrez (matching whatever you have put in the web.xml). Just copy the following lines, and don’t worry about putting the add-on GWT descriptors there (which would be logical), the maven plugins will find them automatically in the add-on jars.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC
"-//Google Inc.//DTD Google Web Toolkit 1.7.0//EN"
"http://google-web-toolkit.googlecode.com/svn/tags/1.7.0/distro-source/core/src/gwt-module.dtd">
<module>
<inherits name="com.vaadin.terminal.gwt.DefaultWidgetSet" />
</module>
Run the webapp
Go to your project, and execute following command:
mvn clean package jetty:run
This starts up a Jetty webserver and deploys our webapp. You should now be able to play around with the webapp.
The problem
When running the previous command, you’ll should see the GWT compiler kicking in and compiling the custom widget. The problem is, the GWT compiler does take its time to do its magic (1.30 minutes on my machine, while simply starting Jetty takes 5 seconds).
I’m not going to sit and watch the GWT compiler sprinkling pixie dust over my add-ons every frick’n time when I want to run my app. Sure JRebel, could help out a lot here, but it should most definitely not be necessary to have my widgets compiled every time. After all, I’m not changing these add-ons at-all, right.
Tweaking pom.xml (The Sequel)
So we just learned that the default pom.xml generated by the Vaadin archetype isn’t friendly when it comes to add-ons. If you take a look at the configuration of the GWT compiler plugin, you’ll notice that the compiled widgets are added to the target folder, and not in the sources of your project:
<webappDirectory>${project.build.directory}/${project.build.finalName}/VAADIN/widgetsets</webappDirectory>
If we change that to our source folder:
<webappDirectory>src/main/webapp/VAADIN/widgetsets</webappDirectory>
the result of the GWT compilation is put in the source of my webapp. This also means I can just check them in together with the rest of my webapp.
The only thing we now need to do, is to make sure we don’t recompile the widgets on every run. I’ve chosen to simply put it in a profile as follows:
<profiles>
<profile>
<id>compile-widgetset</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
....
Whenever I now add a new add-on to the project, I now run the following command:
mvn -Pcompile-widgetset clean compile
and it will compile all add-ons and put the result in my source folders. Running the Jetty webserver as shown above, will now just copy these sources to the war file and boot time is reduced to a minumum again (5 seconds here).
Source
The whole webapp as described in the above steps in fully available on GitHub: https://github.com/jbarrez/vaadin-mvn-addon
Conclusion
Using add-ons with Maven is not that hard, all of that is well-documented (as anything in Vaadin). However, the Maven archetype generates a Maven configuration that isn’t that efficient since it recompiles the add-on widgets on every run. The above steps show how to tweak the config to make it more suitable for real rapid development!
Any comments or improvements are welcome of course!




