So Maven in eclipse is a great time saver (and waster); in that it wastes a tonne of time setting up and learning, but saves a tonne of time in the long run on team projects.

This weeks maven problems have been running suites of testng test when doing a maven build; the old pergen memory not set high enough faults; but this time setting the paremeters was a bit harder.

here’s the fix(es):

set pergen space for eclipse (3.4) higher:
- run eclipse from the command line with the options:

eclipse -vmargs -Xms1536m -Xmx1536m -XX:PermSize=1024m -XX:MaxPermSize=2048m

- give maven more memory

export MAVEN_OPTS="-Xms1536m -Xmx1536m -XX:PermSize=1024m -XX:MaxPermSize=2048m"

now the bit that took ages to figure out – the maven eclipse plugin runs testng test through surefire on the console and returns back output to eclipse, not only that but it’s run through a jar using a jre – so to give this instance of the jre more memory you need to:

  1. Right Click ProjectName > Run As > Maven Build…
  2. Goals: (one of install, deploy etc)
    install -e
  3. JRE Tab > VM Arguments:
    -Xms1536m -Xmx1536m -XX:PermSize=1024m -XX:MaxPermSize=2048m

AFAIK this and only this will allocate enough memory for the the test suite to run :)

Joy

The Joy of VirtualBox

December 14, 2008

@tangent from /blog-design/font-frustrations
I can’t recommend VirtualBox enough; all my life I’ve found frustration in needing tools from both Windows and Linux, which led to me constantly keeping that putty client connected to a linux server. Not now though, no no no no (as two unlimited said);

Here’s a very quick outline which should convey why I’m so pleased with VirtualBox:

I have a full Ubuntu Server 8.10 with the desktop installed running in a virtual box on my vista ultimate, not fullscreen but in a window 1360*768 (nice aspect ratio) which I can easily just alt-tab to and control, if I want to use the mouse I just click in and use, to get the mouse back out I tap the right-ctrl.

Files.. using samba I’ve got all my windows drives mounted in /mnt on ubuntu so common files throughout.

Network.. currently I have a bridge set-up between the virtual box connection and my windows connection, with a bit of tweaking this has allowed me to give the virtual ubuntu it’s own ip address from the router. Thus on my network I have my desktop, the virtual ubuntu, the tablet and rach’s pc. Additionally with some config of port-forwarding I’ve got ssh, mysql, maven proxy, tomcat and apache (port 81) all running on ubuntu and exposed to the internet via a domain mapped to my static ip, whilst every other port is likewise exposed and set to the vista desktop.
@note planning on giving the virtual box it’s own gigabit network card, hence the “currently”.

It’s so liberating because.. well consider, got some files on my desktop (literally on the desktop of my vista) at home that I could do with at work:

  • Open terminal
  • scp -r nath@mydomain:/vista/Users/Nath/Desktop ./
  • done.. and I’ve got those files at work.

The other way.. Shri and Chris have been working late at the office and released a new snapshot into the work-office-local-network maven proxy on shri’s machine, I need them in my maven proxy at home as I’m also working late.. a few weeks ago that was it, can’t work, now though

  • alt-tab into ubuntu
  • ssh in to the work server
  • ssh over to shri’s machine on the private office network
  • cd into his .m2/repository
  • scp -r ./uk nath@mydomain:/usr/local/maven-proxy/local-repo
  • exit exit
  • alt-tab into eclipse running back on the vista desktop
  • right-click project, maven > update snapshots
  • done – all working!

Gripes:
Only one.. the copy paste bucket isn’t shared, so often I copy in windows and paste into ubuntu to find it’s not there. I think we can say thats minor all things considered.

Go get Sun xVM VirtualBox now.